vue中webstrom 识别@
vue3,webstrom配置@符号webstrom不能识别@符号
·
安装 npm install @vue/cli-service --save-dev
在根目录新建一个webstrom.config.js
'use strict'
const path = require('path')
function resolve (dir) {
return path.join(__dirname, '.', dir)
}
module.exports = {
context: path.resolve(__dirname, './'),
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'@': resolve('src'),
// '@views': resolve('src/views'),
// '@comp': resolve('src/components'),
// '@core': resolve('src/core'),
// '@utils': resolve('src/utils')
}
},
}
在webstrom中进行配置。使得westrom能够识别vue框架的配置选项
//如果想要做的更完美一些。再在.gitgnore中,添加如下。
#屏蔽掉webstrom临时文件
/.idea
# 屏蔽 webstrom.config.js 防止别人下载后不知道这是什么
/webstrom.config.js
更多推荐
所有评论(0)