Forum

MDB VUE Select - ho...
 
Notifications
Clear all

MDB VUE Select - how to pass data to component

   RSS

0
Topic starter

example

1 Answer
0
Topic starter

Caller

<simple-select  'One', value: 1}, {text: 'Two', value: 2},]"></simple-select>

Component

<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 selected1 = ref(1);

export default {
    components: {
        MDBSelect
    },
    props: {
        options1: Object
    },
    computed:{
      selectedText(){
          return this.options1[selected1.value-1].text;
      }
    },
    setup() {
        return {
            selected1
        };
    }
};
</script>

 

Odpowiedź

Author Name

Author Email

Your question *

 
Preview 0 Revisions Saved
Share: