Closed web-surfer closed 6 years ago
Chnage define callback
like that
{
content:'Click Here!',
callback : this.callMethod
}
You have already call callMethod
function when define menu item.
For your larger question, dynamic change selected item in advance mode just need change v-model
binded variable.
For example:
<v-selectmenu :data="list" key-field="id" v-model="value1">
</v-selectmenu>
<button @click="value1=3">change selected</button>
<script>
export default {
data(){
list: [
{id:1 ,name:'Chicago Bulls',desc:'芝加哥公牛',abbr:'CHI'},
{id:3 ,name:'Detroit Pistons',desc:'底特律活塞',abbr:'DET'},
{...}
],
value1: null
}
}
</script>
When click change selected
button, the selected item will change.
Is there any way to call a method inside the 'callback' option? For example:
My larger question is: how is one supposed to dynamically change the values in the select? For example: dynamically change whether an option is disabled or not.
Great looking component by the way!