[+] Use dynamic vue rendering
This commit is contained in:
+8
-1
@@ -1,9 +1,16 @@
|
|||||||
import {createApp} from 'vue'
|
import {createApp, h} from 'vue'
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
import router from './scripts/router'
|
import router from './scripts/router'
|
||||||
import {i18n} from "@/messages";
|
import {i18n} from "@/messages";
|
||||||
import '@fortawesome/fontawesome-free/css/all.min.css'
|
import '@fortawesome/fontawesome-free/css/all.min.css'
|
||||||
|
|
||||||
const app = createApp(App).use(router).use(i18n)
|
const app = createApp(App).use(router).use(i18n)
|
||||||
|
.component('Dynamic', {
|
||||||
|
props: ['template'],
|
||||||
|
render() {
|
||||||
|
return h({template: this.template})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// app.config.performance = true
|
// app.config.performance = true
|
||||||
app.mount('#app')
|
app.mount('#app')
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="About" class="markdown-content" v-html="html">
|
<div id="About" class="markdown-content">
|
||||||
|
<Dynamic :template="html"></Dynamic>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
|
runtimeCompiler: true,
|
||||||
devServer: {
|
devServer: {
|
||||||
disableHostCheck: true
|
disableHostCheck: true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user