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指定-select下拉列表应用</title>
    <script src="https://static.gzj2001.com/vue/vue.js"></script>
</head>
<body>
    <div id="app">
      <select name="test" id="">
          <option value="1">apple</option>
          <option value="2">pear</option>
          <option value="3">banner</option>
          <option value="4">header</option>
      </select>

      <select name="test2" id="" v-model="checked">
        <option value="1">apple</option>
        <option value="2">pear</option>
        <option value="X">banner</option>
        <option value="4">header</option>
    </select>
    默认{{checked}}
    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
               checked:"X"
            }
        })
    </script>
</body>
</html>

效果

image.png