foreverjiangting / vue2.0-elementUI-axios-vueRouter

spa for web

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

my-app

Build Status language

my light app

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

在使用时要记得在config中配置url

由于使用了路由,所以webpack配置文件中要修改为,这样才能使用template

resolve: { alias: { 'vue$': 'vue/dist/vue.js' } }

此处使用的是webpack-simple,所以关于字体库要自己配置,并使用url-loader

加载css每次都最好加上style-loader和css-loader,而且要注意书写顺序,尤其是使用sass或less

关于elementUI的坑,自己去实践吧,总体还是不错的。

使用happypack和DllReferencePlugin,构建速度提升很多,从11s到3s,还是不错的

前几天看到有人说项目报错:DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see webpack/loader-utils#56 parseQuery() will be replaced with getOptions() in the next major version of loader-utils.这个是node的错误提醒,关掉就好了,在webpack配置文件中设置process.noDeprecation=true即可。可参考vuejs/vue-loader#666

pwa文件中有关于pwa应用开发的简单配置,可以供参考,https://github.com/Stevenzwzhai/zhihu-daily 这个项目是比较完整的一个pwa项目。

这里添加mockjs,可以正常调用接口

About

spa for web


Languages

Language:Vue 61.4%Language:JavaScript 35.8%Language:HTML 2.8%