Last active
November 25, 2021 14:31
-
-
Save cn-2k/4c1e895d32a2f5f991dfec28a739d211 to your computer and use it in GitHub Desktop.
@vueform/multiselect - state/city
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p class="mb-1 text-brand-mainDark"> | |
Select state | {{selectedState}} | |
</p> | |
<Multiselect | |
placeholder="Select state" | |
:minChars="1" | |
:required="true" | |
autocomplete="undefined" | |
v-model="selectedState" | |
name="states" | |
label="name" | |
value-prop="id" | |
:options="states" | |
:searchable="true" | |
:track-by="'name'" | |
noOptionsText="List empty!" | |
noResultsText="No results found!" | |
@select="getCities" | |
@clear="clearCities" | |
/> | |
<p class="mt-4 mb-1 text-brand-mainDark"> | |
Select city {{selectedCity}} | |
</p> | |
<Multiselect | |
placeholder="Select city" | |
:minChars="1" | |
:required="true" | |
autocomplete="undefined" | |
v-model="selectedCity" | |
name="cities" | |
label="name" | |
value-prop="id" | |
:options="cities" | |
:searchable="true" | |
:track-by="'name'" | |
noOptionsText="List empty!" | |
noResultsText="No results found!" | |
:disabled="!selectedState" | |
/> | |
// v-model = is a reactive prop | |
// options = is a array | |
// value-prop and track-by = is options of filtering |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment