Files
regulatory-management-system/开发日志.md

38 lines
694 B
Markdown
Raw Normal View History

2025-10-24 11:45:27 +08:00
# 前端
## 问题
### vue3 引入@路径
#### 引入path模块问题
node.js 自带的path模块是JavaScript代码要引入ts文件需要安装@type/node模块
```shell
npm install @types/node --save-dev
```
之后就可以加载path。在 vite.config.ts 中加上
```typescript
import path from "path";
resolve: {
//配置别名
alias: [
{
find: /^~/,
replacement: "",
},
{
find: "@",
replacement: path.resolve( __dirname, "src" ),
},
],
},
```
## 组件
### pdf预览组件
使用