• vue中性别表单绑定提交


     1 <!DOCTYPE html>
     2 <html lang="en">
     3 
     4 <head>
     5     <meta charset="UTF-8">
     6     <meta name="viewport" content="width=\, initial-scale=1.0">
     7     <meta http-equiv="X-UA-Compatible" content="ie=edge">
     8     <title>Document</title>
     9     <script src="../vue.js"></script>
    10 </head>
    11 
    12 <body>
    13     <div id="app">
    14         <form action="http://www.baidu.com" method="get">
    15             <label for="male">
    16                 <input type="radio" value="男" name="sex" id="male" v-model="sex">17             </label>
    18             <label for="female">
    19                 <input type="radio" value="女" name="sex"  id="female" v-model="sex">20             </label>
    21             <h2>你选择的是:{{sex}}</h2>
    22             <input type="submit" value="提交">
    23         </form>
    24     </div>
    25 
    26 </body>
    27 <script>
    28     const app = new Vue({
    29         el: " #app ",
    30         data() {
    31             return {
    32                 sex: ""
    33             }
    34         },
    35     })
    36 </script>
    37 
    38 </html>
  • 相关阅读:
    Codeforces Round #249 (Div. 2) D. Special Grid 枚举
    图论二
    C语言中的atan和atan2(转)
    BestCoder Round #79 (div.2)
    数学
    LCA
    二分图
    动态规划
    线段树
    树状数组
  • 原文地址:https://www.cnblogs.com/smile6542/p/12231136.html
Copyright © 2020-2023  润新知