032——VUE中表单控件处理之复选框的处理
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>表单控件处理之复选框的处理 </title> <script src="vue.js"></script> </head> <body> <div id="lantian"> <input type="checkbox" v-model="field.draft">草稿{{field.draft}}<br> <div>{{field.flag}}</div> <input type="checkbox" v-model="field.flag" value="remen">热门 <input type="checkbox" v-model="field.flag" value="lengmen">冷门 </div> <script> var app = new Vue({ el: '#lantian', data: { field: { draft:false, flag:[] } } }); </script> </body> </html>