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'; ...@@ -5,30 +5,22 @@ import createStore from './store';
Vue.use(Vuex); Vue.use(Vuex);
export default () => export default el => {
new Vue({ const { gitlabManagedClusterHelpPath, kubernetesIntegrationHelpPath } = el.dataset;
el: '.js-create-eks-cluster-form-container',
return new Vue({
el,
store: createStore(), store: createStore(),
components: { components: {
CreateEksCluster, CreateEksCluster,
}, },
data() {
const {
gitlabManagedClusterHelpPath,
kubernetesIntegrationHelpPath,
} = document.querySelector(this.$options.el).dataset;
return {
gitlabManagedClusterHelpPath,
kubernetesIntegrationHelpPath,
};
},
render(createElement) { render(createElement) {
return createElement('create-eks-cluster', { return createElement('create-eks-cluster', {
props: { props: {
gitlabManagedClusterHelpPath: this.gitlabManagedClusterHelpPath, gitlabManagedClusterHelpPath,
kubernetesIntegrationHelpPath: this.kubernetesIntegrationHelpPath, kubernetesIntegrationHelpPath,
}, },
}); });
}, },
}); });
};
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
if (gon.features.createEksClusters) { if (gon.features.createEksClusters) {
import(/* webpackChunkName: 'eks_cluster' */ '~/create_cluster/eks_cluster') 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(() => {}); .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