Created
June 6, 2018 13:07
-
-
Save jacobwyke/f799b74176bd6bbe9e4a969d2558b131 to your computer and use it in GitHub Desktop.
Vue.js data source component for just in time (JIT) data display
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> | |
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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage: https://gist.github.com/jacobwyke/eb7e1dedb8c9a68afc99ad4effb1e8a9