Created
August 27, 2020 08:59
-
-
Save Sixl-Daniel/f747d6cbb90d5cab382bbd9758ce933a to your computer and use it in GitHub Desktop.
Vue - Import static data set via options method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script> | |
| import MY_JSON from './json/data.json'; | |
| export default{ | |
| // custom option named myJson | |
| myJson: MY_JSON | |
| } | |
| </script> | |
| <template> | |
| <div> | |
| <div v-for="data in $options.myJson">{{ data }}</div> | |
| </div> | |
| </template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment