.vue文件中 import xxx from '@/xxx' 中@含义
@的定义在 vue.config.js中'use strict'const path = require('path')const defaultSettings = require('./src/settings.js')function resolve(dir) {return path.join(__dirname, dir)}const name = defaultS...
·
@的定义在 vue.config.js中
'use strict'
const path = require('path')
const defaultSettings = require('./src/settings.js')
function resolve(dir) {
return path.join(__dirname, dir)
}
const name = defaultSettings.title || 'vue Element Admin' // page title
// If your port is set to 80,
// use administrator privileges to execute the command line.
// For example, Mac: sudo npm run
const port = 3001 // dev port
configureWebpack: {
// provide the app's title in webpack's name field, so that
// it can be accessed in index.html to inject the correct title.
name: name,
resolve: {
alias: { // @代表 src/这个路径
'@': resolve('src')
}
}
},
由以上的代码可知,@代表 src这个绝对路径
更多推荐
已为社区贡献1条内容
所有评论(0)