[Vuejs]-How do I use an array from an external JS file in a Vue.js component?

4👍

I can’t tell for what reason your code isn’t working. Maybe you just need to export your data from countryCodes.js

So, I am sure this will work

import countryCodes from './countryCodes.js'

countryCodes.js

export const countryCodes = {
  return ['DE', 'EN'];
}
👤samayo

Leave a comment