引入外部文件报错Uncaught SyntaxError: The requested module '/@modules/vue.js' does not provide an export named 'default'
import {createRouter, createWebHashHistory} from'vue-router'
import { vueRouters } from '../utils/global'
// 在 Vue-router新版本中,需要使用createRouter来创建路由
export default createRouter({
// 指定路由的模式,此处使用的是hash模式
history: createWebHashHistory(),
routes: [
...vueRouters()
global.ts
export const vueRouters = () => {
// todo
Please provide a link to a repo that can reproduce the problem you ran into.
A reproduction is required unless you are absolutely sure that the the problem is obvious and the information you provided is enough for us to understand what the problem is. If a report has only vague description (e.g. just a generic error message) and has no reproduction, it will be closed immediately.
你好 我想问下解决方法是配置 optimizeDeps:{include:[]}吗?vue-class-component一直不支持不知道为什么
import { createRouter, createWebHashHistory } from "vue-router";
import {
BASE_ROUTE,
} from "@/router/routes.ts";
const router = createRouter({
end: false,
history: createWebHashHistory(),
sensitive: false,
strict: false,
routes: BASE_ROUTE
});
export default router;
use like this