扫码关注官方订阅号
- +
-
+
ringa_lee
<p id="app"> <p class="min" name="" v-on:click="min">-</p> <input class="text-box" name="pricenum" type="tel" v-model="counter" placeholder="请输入价格" maxlength="12 " /> <p class="add" name="" v-on:click="add">+</p> </p> new Vue({ el: '#app', data: { counter: 0, }, methods: { add: function() { this.counter = parseInt(this.counter) + 1; }, min: function(){ if(this.counter > 0){ this.counter = parseInt(this.counter) - 1; } } } })
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
ringa_lee