vue中尽量减少dom操作。
- 方式一:不推荐使用
自定义属性为data-val,通过e.target.getAttribute()获取。
<span data-val="0" @click="getVal0">点我</span>
getVal0(e){
console.log(e.target.getAttribute('d
vue中尽量减少dom操作。
自定义属性为data-val,通过e.target.getAttribute()获取。
<span data-val="0" @click="getVal0">点我</span>
getVal0(e){
console.log(e.target.getAttribute('d