摘要: 1、下载插件 cnpm install lib-flexible --save cnpm install postcss-plugin-px2rem --save-dev 2、main.js引入 import './mobile/flexible.js' 3、根目录创建postcss.config. 阅读全文
posted @ 2022-05-17 16:59 热心市民宗某§ 阅读(37) 评论(0) 推荐(0) 编辑
摘要: 1、在data里return外判断是否第一次加载页面: let rulesCheck = (rule, value, callback) => { if (!this.isFirstLoad) { if (value.length 0) { callback(new Error('请选择试题分类') 阅读全文
posted @ 2022-05-17 15:30 热心市民宗某§ 阅读(859) 评论(0) 推荐(1) 编辑
摘要: <keep-alive include="com"> <router-view></router-view> </keep-alive> //指定被缓存的组件需要在组建内添加 name=“com” 阅读全文
posted @ 2022-04-28 11:12 热心市民宗某§ 阅读(46) 评论(0) 推荐(0) 编辑
摘要: function Trim(str, is_global) { var result; result = str.replace(/(^\s+)|(\s+$)/g, ""); if (is_global.toLowerCase() == "g") { result = result.replace( 阅读全文
posted @ 2022-04-27 13:25 热心市民宗某§ 阅读(14) 评论(0) 推荐(0) 编辑
摘要: let jkqmes = res.data.map((item,index) => { return Object.assign({}, {'timestamp':item.opTime, 'content':item.opDesc}) }) 额外小知识: let newobj = {}; arr 阅读全文
posted @ 2022-04-19 17:57 热心市民宗某§ 阅读(99) 评论(0) 推荐(0) 编辑
摘要: document.querySelector('#需要定位的ID').scrollIntoView({ behavior: "smooth", // 定义动画过渡效果, "auto"或 "smooth" 之一。默认为 "auto" block: "center", // 定义垂直方向的对齐, "st 阅读全文
posted @ 2022-04-07 17:05 热心市民宗某§ 阅读(28) 评论(0) 推荐(0) 编辑
摘要: function stop(){ var mo=function(e){e.preventDefault();}; document.body.style.overflow='hidden'; document.addEventListener("touchmove",mo,false);//禁止页 阅读全文
posted @ 2022-03-28 13:41 热心市民宗某§ 阅读(33) 评论(1) 推荐(0) 编辑
摘要: const getExport = (data, fileName) => { const blob = new Blob([data]) // let fileName = this.exportTitle; if ('download' in document.createElement('a' 阅读全文
posted @ 2022-03-21 11:07 热心市民宗某§ 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 1、<van-uploader class="list-upload" :after-read="afterRead" accept="image/jpeg,image/png" :preview-image="false" /> 2、 afterRead(file) { var data = ne 阅读全文
posted @ 2022-03-21 10:56 热心市民宗某§ 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 1、Object.assign(this.$data, this.$options.data.call(this)) 阅读全文
posted @ 2022-03-10 16:38 热心市民宗某§ 阅读(111) 评论(2) 推荐(0) 编辑