config/index.js
const path = require('path') // eslint-disable-line
const config = {
alias: {
'@/api': path.resolve(__dirname, '..', 'src/api'),
'@/components': path.resolve(__dirname, '..', 'src/components'),
'@/assets': path.resolve(__dirname, '..', 'src/assets'),
'@/store': path.resolve(__dirname, '..', 'src/store')
}
}
根目录下jsconfig.json
"paths": {
"@/api": ["src/api"],
"@/components": ["src/components"],
"@/assets": ["src/assets"],
"@/store": ["src/store"],
}