摘要:
点击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)
摘要:
<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)
摘要:
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)
摘要:
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)