Commit a61acfdcb725579735574e250f1ef7840975347c
1 parent
99f66405
update Transfer icons
Showing
4 changed files
with
38 additions
and
19 deletions
Show diff stats
examples/routers/transfer.vue
1 | <template> | 1 | <template> |
2 | <Transfer | 2 | <Transfer |
3 | - :data="data1" | ||
4 | - :target-keys="targetKeys1" | ||
5 | - :render-format="render1" | ||
6 | - @on-change="handleChange1"></Transfer> | 3 | + :data="data3" |
4 | + :target-keys="targetKeys3" | ||
5 | + :list-style="listStyle" | ||
6 | + :render-format="render3" | ||
7 | + :operations="['To left','To right']" | ||
8 | + filterable | ||
9 | + @on-change="handleChange3"> | ||
10 | + <div :style="{float: 'right', margin: '5px'}"> | ||
11 | + <Button type="ghost" size="small" @click="reloadMockData">Refresh</Button> | ||
12 | + </div> | ||
13 | + </Transfer> | ||
7 | </template> | 14 | </template> |
8 | <script> | 15 | <script> |
9 | export default { | 16 | export default { |
10 | data () { | 17 | data () { |
11 | return { | 18 | return { |
12 | - data1: this.getMockData(), | ||
13 | - targetKeys1: this.getTargetKeys() | 19 | + data3: this.getMockData(), |
20 | + targetKeys3: this.getTargetKeys(), | ||
21 | + listStyle: { | ||
22 | + width: '250px', | ||
23 | + height: '300px' | ||
24 | + } | ||
14 | } | 25 | } |
15 | }, | 26 | }, |
16 | methods: { | 27 | methods: { |
@@ -19,8 +30,8 @@ | @@ -19,8 +30,8 @@ | ||
19 | for (let i = 1; i <= 20; i++) { | 30 | for (let i = 1; i <= 20; i++) { |
20 | mockData.push({ | 31 | mockData.push({ |
21 | key: i.toString(), | 32 | key: i.toString(), |
22 | - label: '内容' + i, | ||
23 | - description: '内容' + i + '的描述信息', | 33 | + label: 'Content ' + i, |
34 | + description: 'The desc of content ' + i, | ||
24 | disabled: Math.random() * 3 < 1 | 35 | disabled: Math.random() * 3 < 1 |
25 | }); | 36 | }); |
26 | } | 37 | } |
@@ -31,14 +42,15 @@ | @@ -31,14 +42,15 @@ | ||
31 | .filter(() => Math.random() * 2 > 1) | 42 | .filter(() => Math.random() * 2 > 1) |
32 | .map(item => item.key); | 43 | .map(item => item.key); |
33 | }, | 44 | }, |
34 | - render1 (item) { | ||
35 | - return item.label; | 45 | + handleChange3 (newTargetKeys) { |
46 | + this.targetKeys3 = newTargetKeys; | ||
47 | + }, | ||
48 | + render3 (item) { | ||
49 | + return item.label + ' - ' + item.description; | ||
36 | }, | 50 | }, |
37 | - handleChange1 (newTargetKeys, direction, moveKeys) { | ||
38 | - console.log(newTargetKeys); | ||
39 | - console.log(direction); | ||
40 | - console.log(moveKeys); | ||
41 | - this.targetKeys1 = newTargetKeys; | 51 | + reloadMockData () { |
52 | + this.data3 = this.getMockData(); | ||
53 | + this.targetKeys3 = this.getTargetKeys(); | ||
42 | } | 54 | } |
43 | } | 55 | } |
44 | } | 56 | } |
src/components/transfer/operation.vue
1 | <template> | 1 | <template> |
2 | <div :class="prefixCls + '-operation'"> | 2 | <div :class="prefixCls + '-operation'"> |
3 | <i-button type="primary" size="small" :disabled="!rightActive" @click.native="moveToLeft"> | 3 | <i-button type="primary" size="small" :disabled="!rightActive" @click.native="moveToLeft"> |
4 | - <Icon type="ios-arrow-left"></Icon> {{ operations[0] }} | 4 | + <Icon type="ios-arrow-back"></Icon> <span>{{ operations[0] }}</span> |
5 | </i-button> | 5 | </i-button> |
6 | <i-button type="primary" size="small" :disabled="!leftActive" @click.native="moveToRight"> | 6 | <i-button type="primary" size="small" :disabled="!leftActive" @click.native="moveToRight"> |
7 | - {{ operations[1] }} <Icon type="ios-arrow-right"></Icon> | 7 | + <span>{{ operations[1] }}</span> <Icon type="ios-arrow-forward"></Icon> |
8 | </i-button> | 8 | </i-button> |
9 | </div> | 9 | </div> |
10 | </template> | 10 | </template> |
src/components/transfer/search.vue
src/styles/components/transfer.less
@@ -115,7 +115,7 @@ | @@ -115,7 +115,7 @@ | ||
115 | } | 115 | } |
116 | &-operation { | 116 | &-operation { |
117 | display: inline-block; | 117 | display: inline-block; |
118 | - overflow: hidden; | 118 | + //overflow: hidden; |
119 | margin: 0 16px; | 119 | margin: 0 16px; |
120 | vertical-align: middle; | 120 | vertical-align: middle; |
121 | 121 | ||
@@ -127,6 +127,13 @@ | @@ -127,6 +127,13 @@ | ||
127 | margin-bottom: 12px; | 127 | margin-bottom: 12px; |
128 | } | 128 | } |
129 | } | 129 | } |
130 | + .@{btn-prefix-cls}{ | ||
131 | + span { | ||
132 | + i, span{ | ||
133 | + vertical-align: middle; | ||
134 | + } | ||
135 | + } | ||
136 | + } | ||
130 | } | 137 | } |
131 | } | 138 | } |
132 | .select-item(@transfer-prefix-cls, @transfer-item-prefix-cls); | 139 | .select-item(@transfer-prefix-cls, @transfer-item-prefix-cls); |
133 | \ No newline at end of file | 140 | \ No newline at end of file |