xxxxxxxxxx
1
<template>
2
<MDBSelect id="selectRef" v-model:options="options1" v-model:selected="selected1" />
3
</template>
xxxxxxxxxx
1
<style>
2
#app {
3
font-family: Roboto, Helvetica, Arial, sans-serif;
4
}
5
</style>
xxxxxxxxxx
1
<script>
2
import { MDBSelect } from "mdb-vue-ui-kit";
3
import { ref, onMounted } from "vue";
4
5
export default {
6
components: {
7
MDBSelect
8
},
9
setup() {
10
const options1 = ref([
11
{ text: "One", value: 1 },
12
{ text: "Two", value: 2 },
13
{ text: "Three", value: 3 },
14
{ text: "Four", value: 4 },
15
{ text: "Five", value: 5 },
16
{ text: "Six", value: 6 },
17
{ text: "Seven", value: 7 },
18
{ text: "Eight", value: 8 }
19
]);
20
const selected1 = ref("");
21
22
23
onMounted(()=>{
24
const inputEl = document.querySelector("#selectRef input")
25
inputEl.name = "my-name"
26
})
27
28
return {
29
options1,
30
selected1,
31
};
32
}
33
};
34
</script>
Console errors: 0