会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
吴小明
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
17
18
19
20
21
22
23
24
25
···
63
下一页
2021年6月4日
vue-touch监听手指左滑右滑事件
摘要: 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 吴小明-
阅读(1393)
评论(0)
推荐(0)
2021年6月3日
vue事件代理
摘要: 点击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 吴小明-
阅读(1490)
评论(0)
推荐(0)
vue通过ref获取组件渲染后的dom(this.$refs.xxxRef.$el)
摘要: <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 吴小明-
阅读(489)
评论(0)
推荐(0)
vue水印-第二种方法:通过指令
摘要: 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 吴小明-
阅读(158)
评论(0)
推荐(0)
vue水印-第一种方法
摘要: 1、common文件夹下新建 watermark.js: /** 水印添加方法 */ let setWatermark = (str1, str2) => { let id = '1.23452384164.123412415' if (document.getElementById(id) !==
阅读全文
posted @ 2021-06-03 18:02 吴小明-
阅读(143)
评论(0)
推荐(0)
2021年6月2日
js获取随机打乱的数组
摘要: 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 吴小明-
阅读(73)
评论(0)
推荐(0)
js计算代码运行时间
摘要: console.time("加载时间") // …… console.timeEnd("加载时间")
阅读全文
posted @ 2021-06-02 22:59 吴小明-
阅读(384)
评论(0)
推荐(0)
vue.config.js配置alias别名
摘要: const path = require('path') module.exports = { lintOnSave: false, // 是否在开发环境下每次保存代码时都启用 eslint 验证 // chainWebpack: (config) => { // config.resolve.al
阅读全文
posted @ 2021-06-02 21:45 吴小明-
阅读(2795)
评论(0)
推荐(1)
vue通过原生事件复制文本(兼容ios)
摘要: 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 吴小明-
阅读(274)
评论(0)
推荐(0)
vue通过插件clipboard复制文本
摘要: 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 吴小明-
阅读(426)
评论(0)
推荐(0)
上一页
1
···
17
18
19
20
21
22
23
24
25
···
63
下一页
公告