html:

<input class="weui-check" type="checkbox" name="checkbox1" value="123" v-model="checkVal" />123 

<input class="weui-check" type="checkbox" name="checkbox1" value="456" v-model="checkVal" />456

<input class="weui-check" type="checkbox" name="checkbox1" value="789" v-model="checkVal" />789 

 js:

let vm = new Vue({
   el:'#app',
   data:{
     checkVal:[]
   } 
}) 

选中第一项和第二项,checkVal的值['123','456']

转载于:https://www.cnblogs.com/Super-scarlett/p/10648014.html

Logo

前往低代码交流专区

更多推荐