js
javaScript知识点
cmmboy1990
积累、
展开
-
普通Html 页面 rem适配
核心代码:<script> ;(function(win, doc) { 'use strict'; var options = { width: 750, dpr: win.devicePixelRatio }; var html = doc.documentElement, width = html.getAttribute('data-width') || options.width, dpr = html.原创 2022-05-13 16:35:40 · 537 阅读 · 0 评论 -
vue使用moment插件格式化时间
1.npm导入npm install moment --save2.main.js 中全局注册import moment from 'moment'; //时间moment.locale('zh-cn'); //设置语言 或 moment.lang('zh-cn'); Vue.prototype.moment = moment;//赋值使用3.页面中使用this.moment().format('YYYY-MM-DD:HH:MM:SS')//获取当前的时间this.moment().fo原创 2022-01-17 09:20:20 · 642 阅读 · 0 评论