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-10 02:17:51 +08:00
|
|
|
import { mountWithTurbolinks } 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;
|
2023-11-10 02:17:51 +08:00
|
|
|
mountWithTurbolinks(app, '#labelTemplateContainer');
|
2022-08-04 16:51:30 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
initLabelTemplateComponent();
|