Kaustubh
1 year ago
21
0
Vue

Dropdown model-list-select :list not working in Popup Modal

Posted 1 year ago by Kaustubh

Hi,

i used dropdown input in popup model and assigned array value in :list="conopt" when i select the option i get the country name, but i was expecting for array which has id, name, sortname.

When i put that dropdown outside popup model i got my expected result. But problem is that i want that result in popup model.

// USING Dropdown List in Popup Modal (Not Working as Expected)

<div>
    <b-modal title="Add Supplier" hide-footer size="lg" v-model="largeModal" @ok="largeModal = false" style="width: 140%; margin: auto;">
    <model-list-select :list="conopt" class="form-control"
        option-value="country_name"
        option-text="country_name"
        v-model="con"
        @input="state">
    </model-list-select >
</b-modal>
</div>

<script type="text/javascript">
    state(conopt){
      console.log(conopt) // Result India (Expecting array output)
    }
</script>

USING Dropdown List outside Popup Modal (Working as Expected)

<div>
    <model-list-select :list="conopt" class="form-control"
        option-value="country_name"
        option-text="country_name"
        v-model="con"
        @input="state">
    </model-list-select >
</div>

<script type="text/javascript">
    state(conopt){
      console.log(conopt)
        /*
        GETTING EXPECTED RESULT
        {__ob__: Observer}
            country_name:"India"
            id:"45"
            phonecode:"91"
            sortname:"IN"
        */
    }
</script>

Please sign in or create an account to participate in this conversation.