Authored by 李奇

引入iview

@@ -6,11 +6,7 @@ @@ -6,11 +6,7 @@
6 "transform-runtime", 6 "transform-runtime",
7 "transform-object-rest-spread", 7 "transform-object-rest-spread",
8 "transform-async-to-generator", 8 "transform-async-to-generator",
9 - "syntax-dynamic-import",  
10 - ["import", {  
11 - "libraryName": "iview",  
12 - "libraryDirectory": "src/components"  
13 - }] 9 + "syntax-dynamic-import"
14 ] 10 ]
15 } 11 }
16 12
1 import Vue from 'vue'; 1 import Vue from 'vue';
2 import VueRouter from 'vue-router'; 2 import VueRouter from 'vue-router';
3 -import {Button} from 'iview'; 3 +import iView from 'iview';
4 import App from 'vue@/App.vue'; 4 import App from 'vue@/App.vue';
5 import {create, list, decor} from 'vue@/wheel-surf'; 5 import {create, list, decor} from 'vue@/wheel-surf';
6 6
@@ -8,7 +8,7 @@ import 'admin/wheel-surf.page.css'; @@ -8,7 +8,7 @@ import 'admin/wheel-surf.page.css';
8 import 'iview/dist/styles/iview.css'; 8 import 'iview/dist/styles/iview.css';
9 9
10 Vue.use(VueRouter); 10 Vue.use(VueRouter);
11 -Vue.component('Button', Button); 11 +Vue.use(iView);
12 12
13 const router = new VueRouter({ 13 const router = new VueRouter({
14 routes: [ 14 routes: [
1 <template> 1 <template>
2 <div class="list"> 2 <div class="list">
3 <button class="btn btn-primary" @click="toCreate">创建新活动</button> 3 <button class="btn btn-primary" @click="toCreate">创建新活动</button>
4 - <div class="activity-list">活动列表</div> 4 + <div class="activity-list">
  5 + <Table :columns="columns1" :data="data1"></Table>
  6 + </div>
5 </div> 7 </div>
6 </template> 8 </template>
7 <script> 9 <script>
8 module.exports = { 10 module.exports = {
9 data() { 11 data() {
10 - return {  
11 - }; 12 + return {
  13 + columns1: [
  14 + {
  15 + title: 'Name',
  16 + key: 'name'
  17 + },
  18 + {
  19 + title: 'Age',
  20 + key: 'age'
  21 + },
  22 + {
  23 + title: 'Address',
  24 + key: 'address'
  25 + }
  26 + ],
  27 + data1: [
  28 + {
  29 + name: 'John Brown',
  30 + age: 18,
  31 + address: 'New York No. 1 Lake Park',
  32 + date: '2016-10-03'
  33 + },
  34 + {
  35 + name: 'Jim Green',
  36 + age: 24,
  37 + address: 'London No. 1 Lake Park',
  38 + date: '2016-10-01'
  39 + },
  40 + {
  41 + name: 'Joe Black',
  42 + age: 30,
  43 + address: 'Sydney No. 1 Lake Park',
  44 + date: '2016-10-02'
  45 + },
  46 + {
  47 + name: 'Jon Snow',
  48 + age: 26,
  49 + address: 'Ottawa No. 2 Lake Park',
  50 + date: '2016-10-04'
  51 + }
  52 + ]
  53 + }
12 }, 54 },
13 methods: { 55 methods: {
14 toCreate() { 56 toCreate() {
@@ -20,7 +62,6 @@ @@ -20,7 +62,6 @@
20 <style lang="scss"> 62 <style lang="scss">
21 .activity-list { 63 .activity-list {
22 height: 600px; 64 height: 600px;
23 - border: 1px solid #1b6d85;  
24 } 65 }
25 66
26 </style> 67 </style>