vue3 router引入报错 类型注释只能在 TypeScript 文件中使用 、process is not defined

1.类型注释只能在 TypeScript 文件中使用 文件错误 改用ts文件
vue3 router引入报错 类型注释只能在 TypeScript 文件中使用 、process is not defined_第1张图片

2.process is not defined 缺少环境变量
vite.config.ts 添加
define: {
‘process.env’: process.env
}
请添加图片描述
vue3 router引入报错 类型注释只能在 TypeScript 文件中使用 、process is not defined_第2张图片

你可能感兴趣的:(vue3,typescript,javascript,前端,vue3)