微信与webstorm
微信与WebStorm开发常见问题01
微信与WebStorm开发常见问题01
微信与WebStorm开发常见问题01
webstorm支持wx语法提示
1 | 当前webstorm版本2023.1.5 |

webstorm支持@语法跳转
当前webstorm版本2023.1.5
1) 配置映射路径在
app.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 > {
> "pages": [
> "pages/index/index",
> "pages/index/my",
> ],
> "window": {
> "navigationBarTitleText": "跳转路径配置在resolveAlias",
> "navigationBarTextStyle": "black",
> "navigationBarBackgroundColor": "#ffffff",
> "navigationStyle": "custom"
> },
> "resolveAlias": {
> "~/*": "/*",
> "@/config/*": "config/*",
> "@/utils/*": "utils/*"
> }
> }
>
2) 在项目更路径下创建文件
jsconfig.json
1
2
3
4
5
6
7
8
9
10
11
12
13 > 这个app.json 就是在根路径下面
> {
> "compilerOptions": {
> "baseUrl": "./",
> "paths": {
> "@/*": [
> "/*"
> ]
> }
> },
> "exclude": ["node_modules", "miniprogram_npm"]
> }
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14 > 这个app.json 和 jsconfig.json不是同一层
> {
> "compilerOptions": {
> "baseUrl": "./",
> "paths": {
> "@/*": [
> "miniprogram/*"
> ]
> }
> },
> "exclude": ["node_modules", "miniprogram_npm"]
> }
>
>

代码格式化prettier
当前webstorm版本2023.1.5
1 | npm install prettier --save-dev |
让webstorm中支持prettier格式化代码
1 | 01)安装 File->Settings->Plugins( 搜索 prettier) |
1 | .prettierrc.json文件内容 |
1 | .prettierrc.json文件内容( 如果上面文件不生效可以用这个) |

底部
- 官网: 基本语法
- xxxx