vue-adminlte

使用laravel项目集成vue2-admin-lte包,不过在写demo的时候出现了一些情况。vue

  1. 别名 `mix.webpackConfig({ resolve: {node

    alias:{
         'va': 'vue2-admin-lte/src'
     }

    } });` 在webpack.mix.js添加如上代码使用的时候别名并无起做用,只能使用全名路径vue2-admin-lte/src。webpack

  2. 编译出错 npm run dev时报错:Module build failed: ReferenceError: Unknown plugin "transform-runtime" specified in "E:\pub\ubody_pubhealth\node_modules\_vue2-admin-lte@0.4.2@vue2-admin-lte\.babelrc" at 0, attempted to resolve relative to "E:\pub\ubody_pubhealth\node_modules\_vue2-a dmin-lte@0.4.2@vue2-admin-lte"laravel

经过网上查找缘由,执行命令npm install babel-plugin-transform-runtime 解决。 不过又出现:Module build failed: Error: Couldn't find preset "stage-2" relative to directory "E:\pub\ubody_pubhealth\node_modules\_vue2-admin-lte@0.4.2@vue2-admin-lte" 经过网络查找缘由,执行npm install --save-dev babel-preset-stage-2解决问题,编译成功。 这里涉及到.babelrc文件,这个文件只是大概了解一下,并无具体掌握web

本站公众号
   欢迎关注本站公众号,获取更多信息