2020-07-21 12:09:30 +00:00
|
|
|
import Vue from 'vue';
|
|
|
|
import Translate from '~/vue_shared/translate';
|
2021-02-01 15:08:56 +00:00
|
|
|
import PackagesApp from './components/app.vue';
|
2020-07-21 12:09:30 +00:00
|
|
|
import createStore from './store';
|
|
|
|
|
|
|
|
Vue.use(Translate);
|
|
|
|
|
|
|
|
export default () => {
|
|
|
|
const el = document.querySelector('#js-vue-packages-detail');
|
2020-08-07 09:10:15 +00:00
|
|
|
const { package: packageJson, canDelete: canDeleteStr, ...rest } = el.dataset;
|
2020-07-21 12:09:30 +00:00
|
|
|
const packageEntity = JSON.parse(packageJson);
|
|
|
|
const canDelete = canDeleteStr === 'true';
|
|
|
|
|
|
|
|
const store = createStore({
|
|
|
|
packageEntity,
|
|
|
|
packageFiles: packageEntity.package_files,
|
|
|
|
canDelete,
|
|
|
|
...rest,
|
|
|
|
});
|
|
|
|
|
|
|
|
// eslint-disable-next-line no-new
|
|
|
|
new Vue({
|
|
|
|
el,
|
|
|
|
components: {
|
|
|
|
PackagesApp,
|
|
|
|
},
|
|
|
|
store,
|
|
|
|
render(createElement) {
|
|
|
|
return createElement('packages-app');
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|