import { createApp } from 'vue'; import OpenWopiLink from 'ChillMainAssets/vuejs/_components/OpenWopiLink'; import {_createI18n} from "ChillMainAssets/vuejs/_js/i18n"; const i18n = _createI18n({}); //TODO move to chillDocStore or ChillWopi /* tags to load module: */ window.addEventListener('DOMContentLoaded', function (e) { document.querySelectorAll('span[data-module="wopi-link"]') .forEach(function (el) { createApp({ template: '', components: { OpenWopiLink }, data() { return { wopiUrl: el.dataset.wopiUrl, type: el.dataset.docType, options: el.dataset.options !== 'null' ? JSON.parse(el.dataset.options) : {} } } }) .use(i18n) .mount(el) ; }) ; });