<div>
<button @click="addNum(currentVal)">-</button>
<span>{{currentVal}}</span>
<button @click="reduceNum(currentVal)">+</button>
<input type="text" v-model="this.currentVal*1000" @click="aff($event)">
</div>
//点击获取最终价格
aff(e) {
console.log(e.target.value);
},
//点击加1
addNum(num) {
if (num >= 1) {
this.currentVal = num - 1
}
},
// 点击减1
reduceNum(num) {
this.currentVal = num+ 1
},
vue获取div中的数据
于 2021-03-11 19:12:25 首次发布