fix Bug or add example

This commit is contained in:
Ah jung
2021-07-16 17:41:11 +08:00
parent a6aa6d4d6d
commit b4857a7559
27 changed files with 780 additions and 304 deletions

View File

@@ -5,25 +5,31 @@ import router, { setupRouter } from './router'
import { setupStore } from '@/store'
import { setupNaive, setupDirectives, setupGlobalMethods, setupCustomComponents } from '@/plugins'
const app = createApp(App)
async function bootstrap() {
const app = createApp(App)
// 注册全局常用的 naive-ui 组件
setupNaive(app)
// 注册全局常用的 naive-ui 组件
setupNaive(app)
// 注册全局自定义组件,如:<svg-icon />
setupCustomComponents(app)
// 注册全局自定义组件,如:<svg-icon />
setupCustomComponents(app)
// 注册全局自定义指令v-permission权限指令
setupDirectives(app)
// 注册全局自定义指令v-permission权限指令
setupDirectives(app)
// 注册全局方法app.config.globalProperties.$message = message
setupGlobalMethods(app)
// 注册全局方法app.config.globalProperties.$message = message
setupGlobalMethods(app)
// 挂载状态管理
setupStore(app)
// 挂载状态管理
setupStore(app)
// 挂载路由
setupRouter(app)
// 挂载路由
await setupRouter(app)
// 路由准备就绪后挂载APP实例
router.isReady().then(() => app.mount('#app'))
// 路由准备就绪后挂载APP实例
await router.isReady();
app.mount('#app', true);
}
void bootstrap()