TerryZ/v-selectmenu

Cannot set default value

Closed this issue · 2 comments

Hi, when i editing form, i need to set default value of this select box. But it's not working

<v-selectmenu :data="list" class="form-control" v-model="value">
</v-selectmenu>
data () {
    return {
      value: 1,
      list: [
        {id: 1, name: 'Chicago Bulls', desc: '芝加哥公牛'},
        {id: 2, name: 'Cleveland Cavaliers', desc: '克里夫兰骑士'}
      ]
    }
}

The value must be a string type, try this:

data () {
    return {
      value: '1',
      list: [
        {id: 1, name: 'Chicago Bulls', desc: '芝加哥公牛'},
        {id: 2, name: 'Cleveland Cavaliers', desc: '克里夫兰骑士'}
      ]
    }
}

Thanks, problem solved..