Topic: MdbSelect - how to set default value?
<mdb-select v-validate="'required:country|len:2'" :data-vv-as='$t("addressPage.country")' v-model="formData.country" @getValue="getCountryValue" name="country"> <option disabled selected>{{ $t("addressPage.chooseCountry") }}</option> <span v-for="(country, index) in countries" :value="country.code" :key="index">{{ country.name }}</span> </mdb-select> <label>{{ $t("addressPage.country") }}</label>That's my code, adding options :selected="index === 2" doesnt work (it seems it sets selected for all options)
Nommo pro answered 6 years ago
Jakub Mandra staff premium answered 6 years ago
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: MDB Vue
- MDB Version: 4.5.1
- Device: MacBook
- Browser: Chrome
- OS: MacOS
- Provided sample code: No
- Provided link: No