vue 获取点击元素标签+数据

html


js

// 配药表单
f1 = new Vue({
        el:'#f1',
        data:{
            items:[]
        },
        methods: {
            plusNum: function (index,e){
                // console.log(index)
                // let el = e.currentTarget;
                // console.log(el)
                // console.log(el.innerHTML)
                // console.log(this.items[index])
                let num = parseInt(this.items[index].timeFrequency)
                this.items[index].timeFrequency = num+1
            },
            subtractNum: function (index,e){
                // console.log(e)
                let num = parseInt(this.items[index].timeFrequency)
                this.items[index].timeFrequency = (num>0?num:1)-1
            }
        }
    });

你可能感兴趣的:(vue 获取点击元素标签+数据)