Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

225
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!