Notifications
Clear all
BugOverflow
1
Posty
1
Users
0
Reactions
634
Widok
0
13/08/2021 4:35 pm
Topic starter
ref() troubles
1 Answer
0
13/08/2021 4:35 pm
Topic starter
If you use ref(), then you have to use selected.value method
<template> <MDBSelect v-model:options="options1" v-model:selected="selected1" filter/> <span>selected: {{ selectedText }}</span> </template> <script> import {MDBSelect} from "mdb-vue-ui-kit"; import {ref} from "vue"; const options1 = [ {text: "One", value: 1}, {text: "Two", value: 2}, {text: "Three", value: 3}, {text: "Four", value: 4}, {text: "Five", value: 5}, {text: "Six", value: 6}, {text: "Seven", value: 7}, {text: "Eight", value: 8} ]; const selected1 = ref(1); export default { components: { MDBSelect }, computed:{ selectedText(){ return options1[selected1.value-1].text; } }, setup() { return { options1, selected1 }; } }; </script>