摘要: 1、在data里return外判断是否第一次加载页面: let rulesCheck = (rule, value, callback) => { if (!this.isFirstLoad) { if (value.length 0) { callback(new Error('请选择试题分类') 阅读全文
posted @ 2022-05-17 15:30 热心市民宗某§ 阅读(976) 评论(0) 推荐(1)
摘要: <keep-alive include="com"> <router-view></router-view> </keep-alive> //指定被缓存的组件需要在组建内添加 name=“com” 阅读全文
posted @ 2022-04-28 11:12 热心市民宗某§ 阅读(55) 评论(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 热心市民宗某§ 阅读(24) 评论(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 热心市民宗某§ 阅读(109) 评论(0) 推荐(0)
摘要: document.querySelector('#需要定位的ID').scrollIntoView({ behavior: "smooth", // 定义动画过渡效果, "auto"或 "smooth" 之一。默认为 "auto" block: "center", // 定义垂直方向的对齐, "st 阅读全文
posted @ 2022-04-07 17:05 热心市民宗某§ 阅读(37) 评论(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 热心市民宗某§ 阅读(46) 评论(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 热心市民宗某§ 阅读(32) 评论(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 热心市民宗某§ 阅读(261) 评论(0) 推荐(0)
摘要: 1、Object.assign(this.$data, this.$options.data.call(this)) 阅读全文
posted @ 2022-03-10 16:38 热心市民宗某§ 阅读(130) 评论(2) 推荐(0)
摘要: 1、下载 cnpm i qrcodejs2 -S 2、引入 import qrcode from qrcodejs2 3、 creatQrCode(QrCodeUrl) { new QRCode(this.$refs.qrCodeUrl, { text: QrCodeUrl, // 基础路径 wid 阅读全文
posted @ 2022-03-09 09:41 热心市民宗某§ 阅读(33) 评论(0) 推荐(0)