Config configuration in vue and vueconfig Configuration
Configure the alias and extension in the webpack. base. conf file.
Resolve: {extensions :['. js ','. vue ','. json ','. styl '], alias: {'vue $': 'vue/dist/vue. esm. js', '@': resolve ('src'), 'src': path. resolve (_ dirname ,'.. /src '), 'common': path. resolve (_ dirname ,'.. /src/common '), 'components': path. resolve (_ dirname ,'.. /src/components ')}}
After configuring the alias and extension, you can write in main. js.
Import Vue from 'vue '; import App from '. /app'; import Router from 'vue-router '; // you can add' @/'to the front of components, or omit this parameter. // if no alias exists, it must be written as "import goods from '.. /components/goods '; "import goods from 'components/goods'; import seller from 'components/seller '; import ratings from 'components/ratings '; import' @/common/stylus/Index ';