Commit 469f0217 authored by Enrique Alcantara's avatar Enrique Alcantara

Pass el object to init function

parent 41733145
......@@ -5,30 +5,22 @@ import createStore from './store';
Vue.use(Vuex);
export default () =>
new Vue({
el: '.js-create-eks-cluster-form-container',
export default el => {
const { gitlabManagedClusterHelpPath, kubernetesIntegrationHelpPath } = el.dataset;
return new Vue({
el,
store: createStore(),
components: {
CreateEksCluster,
},
data() {
const {
gitlabManagedClusterHelpPath,
kubernetesIntegrationHelpPath,
} = document.querySelector(this.$options.el).dataset;
return {
gitlabManagedClusterHelpPath,
kubernetesIntegrationHelpPath,
};
},
render(createElement) {
return createElement('create-eks-cluster', {
props: {
gitlabManagedClusterHelpPath: this.gitlabManagedClusterHelpPath,
kubernetesIntegrationHelpPath: this.kubernetesIntegrationHelpPath,
gitlabManagedClusterHelpPath,
kubernetesIntegrationHelpPath,
},
});
},
});
};
document.addEventListener('DOMContentLoaded', () => {
if (gon.features.createEksClusters) {
import(/* webpackChunkName: 'eks_cluster' */ '~/create_cluster/eks_cluster')
.then(({ default: initCreateEKSCluster }) => initCreateEKSCluster())
.then(({ default: initCreateEKSCluster }) => {
const el = document.querySelector('.js-create-eks-cluster-form-container');
if (el) {
initCreateEKSCluster(el);
}
})
.catch(() => {});
}
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment