Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

227
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda