原文地址:http://blog.csdn.net/JaneLittle/article/details/72742225


oninput 事件在用户输入时触发,菜鸟教程中的用法是:

这里写图片描述

但是在.vue中这样写是没有作用的:

这里写图片描述

<input type="text" id="cardsNum2"  value="1" @oninput ="inputFunc">
 
 
  • 1
  • 1

这样写也没有作用:

这里写图片描述

<input type="text" id="cardsNum2"  value="1" v-on:oninput ="inputFunc">
 
 
  • 1
  • 1

最后,这样写才起作用:

这里写图片描述

<input type="text" id="cardsNum2"  value="1" v-on:input ="inputFunc">

Logo

前往低代码交流专区

更多推荐