search

Home  >  Q&A  >  body text

javascript - What does @/xxxx in vuerouter import from mean?

For example:

import Menu from '@/components/menu';

Is this es6 syntax

怪我咯怪我咯2761 days ago1602

reply all(2)I'll reply

  • 学习ing

    学习ing2017-07-05 11:03:41

    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'
        }
    }

    reply
    0
  • 漂亮男人

    漂亮男人2017-07-05 11:03:41

    @ 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')
        }
      },

    reply
    0
  • Cancelreply