javascript - What does @/xxxx in vuerouter import from mean?
怪我咯
怪我咯 2017-07-05 11:01:41
0
2
1546

For example:

import Menu from '@/components/menu';

Is this es6 syntax

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(2)
学习ing

This is the path alias of webpack

resolve: {
    // 自动补全的扩展名
    extensions: ['.js', '.vue', '.json'],
    // 默认路径代理
    // 例如 import Vue from 'vue',会自动到 'vue/dist/vue.common.js'中寻找
    alias: {
        '@': resolve('src'),
        '@config': resolve('config'),
        'vue$': 'vue/dist/vue.common.js'
    }
}
漂亮男人

@ is an alias defined by webpack

build/webpack.base.conf.js

  resolve: {
    extensions: ['.js', '.vue', '.json'],
    alias: {
      'vue$': 'vue/dist/vue.esm.js',
      '@': resolve('src')
    }
  },
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template