summaryrefslogtreecommitdiffstats
path: root/assets/js/vue-eeprom.js
blob: 63f9bfb063ff237746acc4d5a4a462b7da02339a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const { createApp } = Vue;
const { loadModule } = window['vue3-sfc-loader'];
const options = {
  moduleCache: {
    vue: Vue,
  },
  getFile(url) {
    return fetch(url).then((resp) =>
      resp.ok ? resp.text() : Promise.reject(resp)
    );
  },
  addStyle(styleStr) {
    const style = document.createElement('style');
    style.textContent = styleStr;
    const ref = document.head.getElementsByTagName('style')[0] || null;
    document.head.insertBefore(style, ref);
  },
  log(type, ...args) {
    console.log(type, ...args);
  },
};
const app = createApp({
  components: {
    VueLantiqEeprom: Vue.defineAsyncComponent(() =>
      loadModule('/assets/js/vue/vue-lantiq-eeprom.vue', options)
    ),
  },
}).mount('#app');