debian-mirror-gitlab/app/assets/javascripts/packages/details/index.js
2020-10-24 23:57:45 +05:30

32 lines
770 B
JavaScript

import Vue from 'vue';
import PackagesApp from './components/app.vue';
import Translate from '~/vue_shared/translate';
import createStore from './store';
Vue.use(Translate);
export default () => {
const el = document.querySelector('#js-vue-packages-detail');
const { package: packageJson, canDelete: canDeleteStr, ...rest } = el.dataset;
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');
},
});
};