scinote-web/app/javascript/packs/vue/label_template.js

23 lines
826 B
JavaScript
Raw Normal View History

import TurbolinksAdapter from 'vue-turbolinks';
2023-10-24 18:54:58 +08:00
import { createApp } from 'vue/dist/vue.esm-bundler.js';
import LabelTemplateContainer from '../../vue/label_template/container.vue';
window.initLabelTemplateComponent = () => {
2023-10-24 18:54:58 +08:00
const app = createApp({
data() {
return {
labelTemplateUrl: $('#labelTemplateContainer').data('label-template-url'),
labelTemplatesUrl: $('#labelTemplateContainer').data('label-templates-url'),
previewUrl: $('#labelTemplateContainer').data('preview-url'),
newLabel: $('#labelTemplateContainer').data('new-label')
};
}
});
2023-10-24 18:54:58 +08:00
app.component('LabelTemplateContainer', LabelTemplateContainer);
app.use(TurbolinksAdapter);
app.config.globalProperties.i18n = window.I18n;
app.mount('#labelTemplateContainer');
};
initLabelTemplateComponent();