admin_vue/09-v-model双向绑定属性使用/v-model实现单选框绑定.html

29 lines
602 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div id="app">
<input type="radio" value="男" v-model="sex">
<input type="radio" value="女" v-model="sex">
<br> data中sex的数据{{sex}}
</div>
</body>
<script src="../JavaScript/vue.min.js"></script>
<script>
const vue = new Vue({
el: "#app",
data: {
message: "你好呀",
sex:"男"
},
})
</script>
</html>