先抛出错误:
以下是配置文件:
main.ts
import { createApp } from 'vue'
import App from './App.vue'
import "tailwindcss/tailwind.css"
import router from "./router/router"
createApp(App).use(router);
createApp(App).mount('#app');
router.ts
import Vue from "vue";
import { createRouter, createWebHashHistory } from "vue-router";
const routes = [
{ path: '/', component: () => import("../page/main.vue") }
]
const router = createRouter({
history: createWebHashHistory(),
routes
});
export default router;
反复检查了很多遍,但是不知道为什么就是报错
解决方法关注这里
main.ts
createApp(App).use(router);
createApp(App).mount('#app');
替换为
const app = createApp(App);
app.use(router);
app.mount('#app');
问题解决
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)