Skip to content

Instantly share code, notes, and snippets.

@Sixl-Daniel
Created August 27, 2020 08:59
Show Gist options
  • Select an option

  • Save Sixl-Daniel/f747d6cbb90d5cab382bbd9758ce933a to your computer and use it in GitHub Desktop.

Select an option

Save Sixl-Daniel/f747d6cbb90d5cab382bbd9758ce933a to your computer and use it in GitHub Desktop.
Vue - Import static data set via options method
<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