Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

230
Vistas
Is it possible to import vue-datepicker language via a variable

I am using vue-datepicker plugin in my project. According to the docs, you set the language like this:

<datepicker :language="nl" />

And

import {nl} from 'vuejs-datepicker/dist/locale'

And

 data() {
   return {
     nl: nl
   }
 }

My question is: Is it possible to use a variable coming from a parent component or an env file to load all of this ?

So something like this:

CountryCode = "nl" //Coming from somewhere

<datepicker :language=CountryCode />
import {CountryCode} from 'vuejs-datepicker/dist/locale'
data() {
  return {
    CountryCode: CountryCode
  }
}

I know the code above is totally incorrect, but just trying to show what i mean, if that makes any sense.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If I'm not mistaken, the only types allowed for a prop are:

  • String
  • Number
  • Boolean
  • Array
  • Object
  • Date
  • Symbol
  • Function

Even passing a Function is usually seen as an anti-pattern, unlike in React.

So, I doubt that this is possible and even if it could, it would be quite strange. So I don't recommend it anyway.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda