-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid prop: custom validator check failed for prop "country". #45
Comments
@p3trur0 Are you able to replicate this? |
Hello @JamesAngier, do you mean something like this? <script>
import Vue from 'vue';
import CountryFlag from '@/CountryFlag.vue';
export default Vue.extend({
name: 'ServeDev',
components: {
CountryFlag
},
data() {
return {
items: {value: 'it'}
};
},
});
</script>
<template>
<div id="app">
<CountryFlag :country='items.value'/>
</div>
</template> If so, it's not complaining on my Chromium installation. Could you please provide more information about your current configuration? |
Hey @p3trur0, here is my component. An example of what countriesFormatted is returning is the following: And the error in the chrome console is the following: My guess is that it is related to using a v-slot. Like I said, it works and shows the flags correctly, just throwing unnecessary warnings :) <script>
import countries from 'i18n-iso-countries'
import Vue from 'vue';
import CountryFlag from 'vue-country-flag'
export default {
name: 'SearchFilter',
data () {
return {
defaultCountry: {
value: '',
text: 'All'
},
defaultState: {
value: '',
text: ''
}
}
},
computed: {
countriesFormatted () {
countries.registerLocale(require('i18n-iso-countries/langs/en.json'))
const countryList = this.countryRaces.map((c) => ({
value: countries.alpha3ToAlpha2(`${c.country}`),
text: countries.getName(`${c.country}`, 'en')
}))
const b = {
value: '',
text: 'All'
}
countryList.unshift(b)
return [...new Set(countryList)]
}
}
}
</script>
<template>
<v-select
dense
hide-details
outlined
v-model="defaultCountry"
:items="countriesFormatted"
label="Country"
@change="defaultState = null"
@input="(country) => setCountryOf(country)">
<template v-slot:item="{ item }">
<span style="margin-right: 5px; margin-top: 3px">
<country-flag :country="item.value" size="small"/>
</span>
<span>{{ item.text }}</span>
</template>
</v-select>
</template> |
<country-flag :country="item.value" size="small"/>
I have tried item.value in Alpha3 and Alpha 2 with the same issues
e.g.
item.value = 'AU'
item.value = 'AUS'
However it works without being binded to item
<country-flag country="AU" size="small"/>
The text was updated successfully, but these errors were encountered: