简体   繁体   中英

Languages don't seem to work in vuejs-datepicker

Following exactly the docs 's instructions on languages, I'm trying to display the date in German format. Instead I still see it in English: "12 Apr 2020".

Also tried in Spanish, still get "12 Apr 2020".

Am I missing something?

import Datepicker from 'vuejs-datepicker'
import {en, de} from 'vuejs-datepicker/dist/locale'

data () {
    return {
      en: en,
      es: es
    }
}

<datepicker :language="de"></datepicker>

In your example you are not returning German, but you are trying to use it.

import Datepicker from 'vuejs-datepicker'
import {en, de, es} from 'vuejs-datepicker/dist/locale'

data () {
    return {
      en: en,
      es: es,
      de: de
    }
}

<datepicker :language="de"></datepicker>

If I adopt this code, the language on the Datepicker will become hard-coded in German. Does anyone know how to rewrite the code so that when the current locale changes, the Datepicker language changes accordingly?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM