Skip to content

Instantly share code, notes, and snippets.

@jacobwyke
Created June 6, 2018 13:07
Show Gist options
  • Save jacobwyke/f799b74176bd6bbe9e4a969d2558b131 to your computer and use it in GitHub Desktop.
Save jacobwyke/f799b74176bd6bbe9e4a969d2558b131 to your computer and use it in GitHub Desktop.
Vue.js data source component for just in time (JIT) data display
<script>
export default {
name: 'data-source',
props: {
source: {
type: String,
required: true
}
},
data: function() {
return {
rawdata: [],
};
},
render() {
return this.$scopedSlots.default({
items: this.rawdata
});
},
created() {
//trigger request to get data from this.source url
...
//enable checks to request more data if needed
...
}
};
</script>
@jacobwyke
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment