mod: remove server render
This commit is contained in:
parent
092c912be4
commit
18eddc76ce
|
@ -16,6 +16,6 @@
|
|||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/entry-client.ts"></script>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vue/server-renderer": "^3.3.6",
|
||||
"@vueup/vue-quill": "^1.2.0",
|
||||
"animate.css": "^4.1.1",
|
||||
"dayjs": "^1.11.10",
|
||||
|
|
|
@ -5,9 +5,6 @@ settings:
|
|||
excludeLinksFromLockfile: false
|
||||
|
||||
dependencies:
|
||||
'@vue/server-renderer':
|
||||
specifier: ^3.3.6
|
||||
version: 3.3.6(vue@3.3.6)
|
||||
'@vueup/vue-quill':
|
||||
specifier: ^1.2.0
|
||||
version: 1.2.0(vue@3.3.6)
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
import { createApp } from './main'
|
||||
import router from './router'
|
||||
import i18n from '@/language/i18n'
|
||||
import { setupRouterGuard } from '@/router/guard'
|
||||
import { setupPinia } from '@/store/index'
|
||||
import '@/styles/index.scss'
|
||||
|
||||
const { app } = createApp()
|
||||
|
||||
// 使用路由守卫
|
||||
setupRouterGuard(router)
|
||||
// 使用 pinia
|
||||
setupPinia(app)
|
||||
|
||||
app.use(router).use(i18n).mount('#app')
|
27
src/main.ts
27
src/main.ts
|
@ -1,7 +1,24 @@
|
|||
import { createSSRApp } from 'vue'
|
||||
// core
|
||||
import { createApp } from 'vue'
|
||||
// APP
|
||||
import App from './App.vue'
|
||||
/* 引入 vue-router */
|
||||
import router from './router'
|
||||
// 引入 i18n
|
||||
import i18n from '@/language/i18n'
|
||||
// 引入路由守卫
|
||||
import { setupRouterGuard } from '@/router/guard'
|
||||
// 引入 pinia
|
||||
import { setupPinia } from '@/store/index'
|
||||
// 引入样式
|
||||
import '@/styles/index.scss'
|
||||
|
||||
export const createApp = () => {
|
||||
const app = createSSRApp(App)
|
||||
return { app }
|
||||
}
|
||||
// 获取 App 实例
|
||||
const app = createApp(App)
|
||||
|
||||
// 使用路由守卫
|
||||
setupRouterGuard(router)
|
||||
// 使用 pinia
|
||||
setupPinia(app)
|
||||
|
||||
app.use(router).use(i18n).mount('#app')
|
||||
|
|
Loading…
Reference in a new issue