diff --git a/demos/vue/SheetJS-vue.js b/demos/vue/SheetJS-vue.js index e508434..7180216 100644 --- a/demos/vue/SheetJS-vue.js +++ b/demos/vue/SheetJS-vue.js @@ -12,8 +12,7 @@ var SJSTemplate = [ '
', '' ].join(""); - -Vue.component('html-preview', { +var component_struct = { template: SJSTemplate, methods: { onchange: function(evt) { @@ -59,4 +58,11 @@ Vue.component('html-preview', { XLSX.writeFile(wb, "sheetjs.xlsx"); } } -}); +}; +var app; +if(Vue.component) { + Vue.component('html-preview', component_struct); +} else { + app = Vue.createApp({}); + app.component('html-preview', component_struct); +} diff --git a/demos/vue/index.html b/demos/vue/index.html index 67cdaa6..1870671 100644 --- a/demos/vue/index.html +++ b/demos/vue/index.html @@ -55,7 +55,8 @@ This demo shows a sample Vue component "html-preview" that: