上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 63 下一页
摘要: 1、下载 npm install vue-touch@next --save 2、main.js中引入 import VueTouch from 'vue-touch' Vue.use(VueTouch, { name: 'v-touch' }) 3、使用,tag渲染成什么标签,默认渲染成div。c 阅读全文
posted @ 2021-06-04 14:32 吴小明- 阅读(1311) 评论(0) 推荐(0) 编辑
摘要: 点击li打印它的index <ul> <li v-for="(item,index) in list" :key="index" @click="handleClick(index)">{{item}}</li> </ul> handleClick(index) { console.log(inde 阅读全文
posted @ 2021-06-03 23:54 吴小明- 阅读(1460) 评论(0) 推荐(0) 编辑
摘要: <div ref="divRef">div</div> <A ref='aRef'></A> 获取dom: mounted() { console.log(this.$refs.divRef) this.$refs.divRef.style.backgroundColor = 'red' conso 阅读全文
posted @ 2021-06-03 23:09 吴小明- 阅读(471) 评论(0) 推荐(0) 编辑
摘要: 1、utils文件夹下新建 directives.js: import Vue from 'vue' Vue.directive('watermark', (el, binding) => { function addWaterMarker(str, parentNode, font, textCo 阅读全文
posted @ 2021-06-03 18:07 吴小明- 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 1、common文件夹下新建 watermark.js: /** 水印添加方法 */ let setWatermark = (str1, str2) => { let id = '1.23452384164.123412415' if (document.getElementById(id) !== 阅读全文
posted @ 2021-06-03 18:02 吴小明- 阅读(120) 评论(0) 推荐(0) 编辑
摘要: getRandomNumber(min, max) { return Math.floor(Math.random() * (max - min + 1) + min) // 返回 [min, max] }, shuffle(arr) { let _arr = arr.slice() // 浅复制 阅读全文
posted @ 2021-06-02 23:15 吴小明- 阅读(62) 评论(0) 推荐(0) 编辑
摘要: console.time("加载时间") // …… console.timeEnd("加载时间") 阅读全文
posted @ 2021-06-02 22:59 吴小明- 阅读(369) 评论(0) 推荐(0) 编辑
摘要: const path = require('path') module.exports = { lintOnSave: false, // 是否在开发环境下每次保存代码时都启用 eslint 验证 // chainWebpack: (config) => { // config.resolve.al 阅读全文
posted @ 2021-06-02 21:45 吴小明- 阅读(2340) 评论(0) 推荐(1) 编辑
摘要: handleCopyName() { let str = this.temp.part1.realname this.copy(str) }, copy(str) { const save = (e) => { e.clipboardData.setData('text/plain', str) e 阅读全文
posted @ 2021-06-02 16:47 吴小明- 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 1、下载 npm install clipboard --save 2、在需要复制的组件中引入 import Clipboard from 'clipboard' 也可以在main.js中引入: import Clipboard from 'clipboard' Vue.prototype.$cli 阅读全文
posted @ 2021-06-02 16:32 吴小明- 阅读(361) 评论(0) 推荐(0) 编辑
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 63 下一页