vue.jsに基づくプルダウン枠の値のデフォルトおよびバインディング問題


一、今日はvueの中で枠を引く問題に出会ったので、何かを書いて足跡を残します。

<template>

 <select v-model='selected' @click="disable()">
 <option v-for="(option,index) in options" v-bind:value="option.value" :disabled="option.disabled">
  {{ option.text }}{{index}}{{option.disabled}}
 </option>
 </select>
 <span>Selected: {{ selected }}</span>
</template>
<script>
 export default{
 name: 'second',
 data(){
  return {
  selected: 'sex', //        
  options: [
   {text: '      ', value: 'sex', disabled: ''},
   {text: ' ', value: '1'},
   {text: ' ', value: '2'}
  ]
  }
 },
 methods: {
  disable: function () {
  this.options[0].disabled = disabled;
  },
 }
 }
</script>
以上のvue.jsに基づいて、コンボボックスの値についてのデフォルトとバインディングの問題は、すべてのコンテンツを共有するための小編集です。