+
82
-

vue中checkbox select radio怎么写?

vue中checkbox select radio怎么写?

高手回复

+
1
-

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>BFW NEW PAGE</title>
<script id="bfwone" data="dep=vue&err=0" type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/bfwone.js"></script>
<script type="text/javascript">
bready(function() {
var vm = new Vue({
el: '#app',
data: {
msg: 'hello',
hobby2: []
},
created() {
console.log('created')
},
method: {
login: function() {
alert(1)
}
}
})
});
</script>
<style>
</style>
</head>
<body>
<div id="app">
<div>
请选择你的爱好
</div>
<input type="checkbox" v-model="hobby2" value="游泳">游泳
<input type="checkbox" v-model="hobby2" value="健身">健身
<input type="checkbox" v-model="hobby2" value="旅游">旅游
<div>
你已选中:{{hobby2}}
</div>
</div>
</body>
</html>


by bfwui
我知道答案,我要回答