yuantianjiao 6 år sedan
förälder
incheckning
b7d5393a1c
5 ändrade filer med 35 tillägg och 12 borttagningar
  1. 1
    5
      .babelrc
  2. 1
    1
      package.json
  3. 3
    0
      src/main.js
  4. 22
    0
      src/page/test.vue
  5. 8
    6
      src/router/index.js

+ 1
- 5
.babelrc Visa fil

@@ -8,11 +8,7 @@
8 8
     }],
9 9
     "stage-2"
10 10
   ],
11
-  "plugins": ["transform-vue-jsx", "transform-runtime",["import", {
12
-    "libraryName": "vant",
13
-    "libraryDirectory": "es",
14
-    "style": true
15
-  }]],
11
+  "plugins": ["transform-vue-jsx", "transform-runtime"],
16 12
   "env": {
17 13
     "test": {
18 14
       "presets": ["env", "stage-2"],

+ 1
- 1
package.json Visa fil

@@ -14,7 +14,7 @@
14 14
     "build": "node build/build.js"
15 15
   },
16 16
   "dependencies": {
17
-    "vant": "^1.1.14",
17
+    "vant": "^1.1.15",
18 18
     "vue": "^2.5.2",
19 19
     "vue-router": "^3.0.1"
20 20
   },

+ 3
- 0
src/main.js Visa fil

@@ -3,7 +3,10 @@
3 3
 import Vue from 'vue'
4 4
 import App from './App'
5 5
 import router from './router'
6
+import Vant from 'vant'
7
+import 'vant/lib/vant-css/index.css'
6 8
 
9
+Vue.use(Vant)
7 10
 Vue.config.productionTip = false
8 11
 
9 12
 /* eslint-disable no-new */

+ 22
- 0
src/page/test.vue Visa fil

@@ -0,0 +1,22 @@
1
+<template>
2
+    <div>
3
+        <van-button type="default">默认按钮</van-button>
4
+        <van-button type="primary">主要按钮</van-button>
5
+        <van-button type="warning">警告按钮</van-button>
6
+        <van-button type="danger">危险按钮</van-button>
7
+    </div>
8
+</template>
9
+
10
+<script>
11
+// import { Button } from 'vant'
12
+export default {
13
+  data () {
14
+    return {
15
+      a: '1'
16
+    }
17
+  }
18
+}
19
+</script>
20
+
21
+<style lang="scss" scoped>
22
+</style>

+ 8
- 6
src/router/index.js Visa fil

@@ -1,14 +1,16 @@
1 1
 import Vue from 'vue'
2 2
 import Router from 'vue-router'
3
-
3
+const test = () =>
4
+  import(/* webpackChunkName: "test" */
5
+    '../page/test')
4 6
 Vue.use(Router)
5 7
 
6 8
 export default new Router({
7 9
   routes: [
8
-    // {
9
-    //   path: '/',
10
-    //   name: 'userCenter',
11
-    //   component: userCenter
12
-    // }
10
+    {
11
+      path: '/',
12
+      name: 'test',
13
+      component: test
14
+    }
13 15
   ]
14 16
 })