@的定义在 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这个绝对路径

Logo

前往低代码交流专区

更多推荐