Create reusable code for initializing components
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Our documentation mentions that each bundle should create a new Vue app using something like the following:
document.addEventListener('DOMContentLoaded', () => new Vue({
el: '.js-vue-app',
data() {
const dataset = this.$options.el.dataset;
return {
endpoint: dataset.endpoint,
};
},
render(createElement) {
return createElement('my-component', {
props: {
endpoint: this.isLoading,
},
});
},
}));
I'm wondering if it's possible to create a helper function to reduce the boilerplate code we have throughout our vue bundles
Edited by 🤖 GitLab Bot 🤖