2023-10-24 18:54:58 +08:00
|
|
|
import { createApp } from 'vue/dist/vue.esm-bundler.js';
|
2022-08-04 16:51:30 +08:00
|
|
|
import LabelTemplateContainer from '../../vue/label_template/container.vue';
|
2023-11-09 02:32:43 +08:00
|
|
|
import { handleTurbolinks } from './helpers/turbolinks.js';
|
2022-08-04 16:51:30 +08:00
|
|
|
|
|
|
|
window.initLabelTemplateComponent = () => {
|
2023-10-24 18:54:58 +08:00
|
|
|
const app = createApp({
|
2022-08-04 16:51:30 +08:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
labelTemplateUrl: $('#labelTemplateContainer').data('label-template-url'),
|
2022-08-04 19:36:14 +08:00
|
|
|
labelTemplatesUrl: $('#labelTemplateContainer').data('label-templates-url'),
|
2022-08-24 19:55:54 +08:00
|
|
|
previewUrl: $('#labelTemplateContainer').data('preview-url'),
|
2022-08-04 19:36:14 +08:00
|
|
|
newLabel: $('#labelTemplateContainer').data('new-label')
|
2022-08-04 16:51:30 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
});
|
2023-10-24 18:54:58 +08:00
|
|
|
app.component('LabelTemplateContainer', LabelTemplateContainer);
|
|
|
|
app.config.globalProperties.i18n = window.I18n;
|
|
|
|
app.mount('#labelTemplateContainer');
|
2023-11-09 02:32:43 +08:00
|
|
|
handleTurbolinks(app);
|
2022-08-04 16:51:30 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
initLabelTemplateComponent();
|