Anuja P
Anuja P

Reputation: 2143

Useing VueJS Multiselect Plugin Need to reset the dropdown selection on form submit success

I am using Vue Js Multiselect plugin. https://vue-multiselect.js.org/#sub-single-select Using is for single search. I need to reset the value which are selected in the dropdown once the form successfully get submitted.

              <multiselect
            ref="vms_country"
            id="countryCode_alpha_3"
            v-model="countryCodeList"
            placeholder="Select Country"
            :options="getList"
            label="country_name"
            track-by="code"
            :close-on-select="true"
            :clear-on-select="false"
            :allow-empty="false"
            @select="dispatAction">
          </multiselect>

Any function which we can use to reset the value without reloading the page.

Upvotes: 0

Views: 44

Answers (1)

Anuja P
Anuja P

Reputation: 2143

I was able to this by assigneing the null to v modal in finally of form submit function call.

.finally(() => {
      this.countryCodeList = null;
    })

Upvotes: 0

Related Questions