Closed Menark closed 4 years ago
The problem can be bypassed by adding :key
. But it doesn't solve problem.
Yes, you can forceupdate by add :key
now.
I'll fix the bug soon.
<DatePicker
ref="datePicker"
v-model="dateRange"
:lang="lang"
:key="lang"
/>
import 'vue2-datepicker/locale/ru'
export default {
data() {
return {
lang: 'en',
};
},
methods: {
changeLocale() {
this.lang = this.lang === 'en' ? 'ru' : 'en';
},
},
};
Thank you.
v3.2.2 fixed it.
Vue2-datepicker version: 3.0.1 Vue version: 2.6.10 Browser: Chrome 78.0.3904.108
Steps to reproduce Adding
:lang
prop with computed property which return object with custom localization depending on site localization (ru or en) . Change site localizaion by button. Open DatePicker.Reproduction Link or Source Code Ru:
En:
DatePicker:
Computed propperty:
Expected behavior Month, year, weekdays language names should change depending on current
lang
prop.Actual behavior Month, year, weekdays names don't change depending on current
lang
prop. Prop works well. Components TableMonth and others use injected locale, which changes only on mount.