Browse Source

optimize update.md

ustbhuangyi 7 years ago
parent
commit
15fa9623f7
4 changed files with 40 additions and 37 deletions
  1. 1 2
      .eslintrc.js
  2. 2 0
      README.md
  3. 0 2
      src/App.vue
  4. 37 33
      update.md

+ 1 - 2
.eslintrc.js

@@ -26,7 +26,6 @@ module.exports = {
     'semi': ['error', 'always'],
     'no-tabs': 0,
     'indent': 0,
-    'space-before-function-paren': 0,
-    'no-multiple-empty-lines': ["error", { "max": 2, "maxBOF": 1}]
+    'space-before-function-paren': 0
   }
 }

+ 2 - 0
README.md

@@ -4,6 +4,8 @@ Vue.js 高仿饿了么外卖 App 课程源码,课程地址: http://coding.im
 本源码基于 GPL 协议,仅仅用于 Vue 实战项目的学习,不可作为商业用途。
 我们抵制和鄙视一切盗版侵权行为,请尊重作者的劳动果实!
 
+**注意:** 由于新版 vue-cli 已经改变,使用新版 vue-cli 初始化项目的同学参考[更新说明](https://github.com/ustbhuangyi/vue-sell/blob/master/update.md)
+
 [项目演示地址](http://ustbhuangyi.com/sell/)
 
 ![二维码](https://qr.api.cli.im/qr?data=http%253A%252F%252Fustbhuangyi.com%252Fsell%252F%2523%252Fgoods&level=H&transparent=false&bgcolor=%23ffffff&forecolor=%23000000&blockpixel=12&marginblock=1&logourl=&size=280&kid=cliim&key=686203a49c4613080b5b3004323ff977)

+ 0 - 2
src/App.vue

@@ -49,7 +49,6 @@
       'v-header': header
     }
   };
-
 </script>
 
 <style lang="stylus" rel="stylesheet/stylus">
@@ -61,7 +60,6 @@
     height: 40px
     line-height: 40px
     border-1px(rgba(7, 17, 27, 0.1))
-  //border-bottom: 1px solid rgba(7, 17, 27, 0.1)
     .tab-item
       flex: 1
       text-align: center

+ 37 - 33
update.md

@@ -2,7 +2,7 @@
 ===================
 
 
-使vue-sell项目适配最新的vue-cli
+使 vue-sell 项目适配最新的 vue-cli
 
 ----------
 
@@ -11,17 +11,17 @@
 -------------
 
 
-####1.安装vue-resource  better-scroll
+#### 1.安装 vue-resource better-scroll
 ```
 cnpm install vue-resource better-scroll --save
 ```
 
-####2.安装stylus stylus-loader 
+#### 2.安装stylus stylus-loader 
 ```
 cnpm install stylus stylus-loader --save-dev
 ```
 
-####3.设置缩略路径
+#### 3.设置缩略路径
 >build/webapck.base.conf.js
 ```
     {
@@ -31,7 +31,7 @@ cnpm install stylus stylus-loader --save-dev
     }
 ```
 
-####4.修改.eslintrc.js 添加规则
+#### 4.修改.eslintrc.js 添加规则
 >/.eslintrc.js
 ```
     'semi': ['error', 'always'],
@@ -40,18 +40,7 @@ cnpm install stylus stylus-loader --save-dev
     'space-before-function-paren': 0
 ```
 
-
-
-####5.http://eslint.org/docs/rules/no-multiple-empty-lines  Too many blank lines at the end of file. Max of 0 allowed src\App.vue:52:1   App.vue报错
-
-.eslintrc.js 添加规则
->/.eslintrc.js
-```
-    'no-multiple-empty-lines': ["error", { "max": 2, "maxBOF": 1}]
-```
-
-
-####6.修改config目录下的index.js文件
+#### 5.修改config目录下的index.js文件
 
 修改host
 >/config/index.js
@@ -60,7 +49,7 @@ host: '0.0.0.0'
 ```
 
 
-####7.删除dev-server.js文件,使用webpack内置的devServer,设置before()
+#### 6.使用webpack内置的devServer,设置before()
 >/build/webpack.dev.conf.js
 ```
 devServer: {
@@ -90,20 +79,35 @@ devServer: {
 ```
 
 
-####8.路由栏     商品 评论 商家   的下划线消失了
-修改文件样式
->/src/App.vue
- 
- 将.tab 选择器下的
-```
-border-1px(rgba(7, 17, 27, 0.1))
-```
-移到注释
-```
-//border-bottom: 1px solid rgba(7, 17, 27, 0.1)
-```
-之前
+#### 7.在单独的 router.js 路由文件中编写路由
+>/src/router/index.js
 
+```js
+import Vue from 'vue';
+import Router from 'vue-router';
+import goods from 'components/goods/goods';
+import ratings from 'components/ratings/ratings';
+import seller from 'components/seller/seller';
+
+Vue.use(Router);
+
+const routes = [{
+  path: '/',
+  redirect: '/goods'
+}, {
+  path: '/goods',
+  component: goods
+}, {
+  path: '/ratings',
+  component: ratings
+}, {
+  path: '/seller',
+  component: seller
+}];
+
+export default new Router({
+    linkActiveClass: 'active',
+    routes
+});
+```
 
-####9.从App.vue提取路由
->/src/router/index.js