image.png

代码

<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数据绑定之v-model指定-radio单选应用</title>
    <script src="https://static.gzj2001.com/vue/vue.js"></script>
</head>
<body>
    <div id="app">
     <input type="radio" name="" id="" v-model="radio" value="男">男
     <input type="radio" name="" id="" v-model="radio" value="女">女
      <br>
      {{radio}}
    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
                radio:"男"
            }
        })
    </script>
</body>
</html>