Commit 891f61d875388b8e256abfb1bb07e3afe74ab9a1
1 parent
411cc217
fixed #577
Showing
3 changed files
with
23 additions
and
38 deletions
Show diff stats
examples/routers/date.vue
1 | <template> | 1 | <template> |
2 | <div> | 2 | <div> |
3 | {{ val1 }} | 3 | {{ val1 }} |
4 | + <Date-picker type="datetime" placeholder="选择日期和时间" style="width: 200px"></Date-picker> | ||
4 | <Date-picker v-model="val1" type="date" placeholder="选择日期" style="width: 200px"></Date-picker> | 5 | <Date-picker v-model="val1" type="date" placeholder="选择日期" style="width: 200px"></Date-picker> |
6 | + <Date-picker type="daterange" placement="bottom-end" placeholder="选择日期" style="width: 200px"></Date-picker> | ||
5 | <div @click="val1 = '2017-03-02'">change</div> | 7 | <div @click="val1 = '2017-03-02'">change</div> |
6 | </div> | 8 | </div> |
7 | </template> | 9 | </template> |
examples/routers/table.vue
1 | <template> | 1 | <template> |
2 | - <div> | ||
3 | - <Row> | ||
4 | - <i-col span="12"> | ||
5 | - <i-table border :content="self" :columns="columns7" :data="data6" :context="self"></i-table> | ||
6 | - </i-col> | ||
7 | - </Row> | ||
8 | - </div> | 2 | + <Table border :context="self" :columns="columns7" :data="data6"></Table> |
9 | </template> | 3 | </template> |
10 | <script> | 4 | <script> |
11 | export default { | 5 | export default { |
12 | data () { | 6 | data () { |
13 | return { | 7 | return { |
14 | - info: '123', | ||
15 | self: this, | 8 | self: this, |
16 | columns7: [ | 9 | columns7: [ |
17 | { | 10 | { |
18 | title: '姓名', | 11 | title: '姓名', |
19 | key: 'name', | 12 | key: 'name', |
20 | -// render (row, column, index) { | ||
21 | -// return `<Icon type="person"></Icon> <strong>${row.name}</strong>`; | ||
22 | -// } | 13 | + render (row, column, index) { |
14 | + return `<div style="white-space:nowrap;"><Date-picker type="date" placeholder="选择日期" style="width: 200px"></Date-picker></div>`; | ||
15 | + } | ||
23 | }, | 16 | }, |
24 | { | 17 | { |
25 | title: '年龄', | 18 | title: '年龄', |
@@ -35,7 +28,7 @@ | @@ -35,7 +28,7 @@ | ||
35 | width: 150, | 28 | width: 150, |
36 | align: 'center', | 29 | align: 'center', |
37 | render (row, column, index) { | 30 | render (row, column, index) { |
38 | - return `{{ column }}`; | 31 | + return `<i-button type="primary" size="small" @click="show(${index})">查看</i-button> <i-button type="error" size="small" @click="remove(${index})">删除</i-button>`; |
39 | } | 32 | } |
40 | } | 33 | } |
41 | ], | 34 | ], |
@@ -45,29 +38,24 @@ | @@ -45,29 +38,24 @@ | ||
45 | age: 18, | 38 | age: 18, |
46 | address: '北京市朝阳区芍药居' | 39 | address: '北京市朝阳区芍药居' |
47 | }, | 40 | }, |
48 | -// { | ||
49 | -// name: '张小刚', | ||
50 | -// age: 25, | ||
51 | -// address: '北京市海淀区西二旗' | ||
52 | -// }, | ||
53 | -// { | ||
54 | -// name: '李小红', | ||
55 | -// age: 30, | ||
56 | -// address: '上海市浦东新区世纪大道' | ||
57 | -// }, | ||
58 | -// { | ||
59 | -// name: '周小伟', | ||
60 | -// age: 26, | ||
61 | -// address: '深圳市南山区深南大道' | ||
62 | -// } | 41 | + { |
42 | + name: '张小刚', | ||
43 | + age: 25, | ||
44 | + address: '北京市海淀区西二旗' | ||
45 | + }, | ||
46 | + { | ||
47 | + name: '李小红', | ||
48 | + age: 30, | ||
49 | + address: '上海市浦东新区世纪大道' | ||
50 | + }, | ||
51 | + { | ||
52 | + name: '周小伟', | ||
53 | + age: 26, | ||
54 | + address: '深圳市南山区深南大道' | ||
55 | + } | ||
63 | ] | 56 | ] |
64 | } | 57 | } |
65 | }, | 58 | }, |
66 | - computed: { | ||
67 | - dddfff () { | ||
68 | - return this.info | ||
69 | - } | ||
70 | - }, | ||
71 | methods: { | 59 | methods: { |
72 | show (index) { | 60 | show (index) { |
73 | this.$Modal.info({ | 61 | this.$Modal.info({ |
@@ -78,12 +66,6 @@ | @@ -78,12 +66,6 @@ | ||
78 | remove (index) { | 66 | remove (index) { |
79 | this.data6.splice(index, 1); | 67 | this.data6.splice(index, 1); |
80 | } | 68 | } |
81 | - }, | ||
82 | - mounted () { | ||
83 | - setTimeout(() => { | ||
84 | - this.info = '444'; | ||
85 | -// this.data6[0].name = 'xxx'; | ||
86 | - }, 3000); | ||
87 | } | 69 | } |
88 | } | 70 | } |
89 | </script> | 71 | </script> |
src/styles/components/date-picker.less