Commit 4997bd42dd8d288017de8e2ba3b2dd31f68094c5

Authored by 梁灏
1 parent dcc06127

update Transfer

update Transfer
src/components/checkbox/checkbox.vue
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 v-model="checked" 18 v-model="checked"
19 @change="change"> 19 @change="change">
20 </span> 20 </span>
21 - <slot v-if="showSlot"><span v-el:slot style="display:none">{{ value }}</span></slot> 21 + <slot v-if="showSlot"><span v-el:slot>{{ value }}</span></slot>
22 </label> 22 </label>
23 </template> 23 </template>
24 <script> 24 <script>
@@ -78,8 +78,6 @@ @@ -78,8 +78,6 @@
78 this.updateModel(); 78 this.updateModel();
79 if (this.$els.slot && this.$els.slot.innerHTML === '') { 79 if (this.$els.slot && this.$els.slot.innerHTML === '') {
80 this.showSlot = false; 80 this.showSlot = false;
81 - } else {  
82 - this.$els.slot.style.display = 'inline';  
83 } 81 }
84 } 82 }
85 }, 83 },
src/components/transfer/list.vue
@@ -57,7 +57,8 @@ @@ -57,7 +57,8 @@
57 return [ 57 return [
58 `${this.prefixCls}-body`, 58 `${this.prefixCls}-body`,
59 { 59 {
60 - [`${this.prefixCls}-body-with-search`]: this.filterable 60 + [`${this.prefixCls}-body-with-search`]: this.filterable,
  61 + [`${this.prefixCls}-body-with-footer`]: this.showFooter
61 } 62 }
62 ] 63 ]
63 }, 64 },
@@ -100,7 +101,7 @@ @@ -100,7 +101,7 @@
100 this.updateFilteredData(); 101 this.updateFilteredData();
101 102
102 }, 103 },
103 - ready () { 104 + compiled () {
104 this.showFooter = this.$els.footer.innerHTML !== ''; 105 this.showFooter = this.$els.footer.innerHTML !== '';
105 }, 106 },
106 watch: { 107 watch: {
src/styles/components/transfer.less
@@ -43,10 +43,14 @@ @@ -43,10 +43,14 @@
43 border-top: none; 43 border-top: none;
44 border-radius: 0 0 @border-radius-base @border-radius-base; 44 border-radius: 0 0 @border-radius-base @border-radius-base;
45 position: relative; 45 position: relative;
  46 + overflow: hidden;
46 47
47 &-with-search{ 48 &-with-search{
48 padding-top: 34px; 49 padding-top: 34px;
49 } 50 }
  51 + &-with-footer{
  52 + border-radius: 0;
  53 + }
50 } 54 }
51 55
52 &-content{ 56 &-content{
@@ -90,7 +94,6 @@ @@ -90,7 +94,6 @@
90 } 94 }
91 95
92 &-footer{ 96 &-footer{
93 - margin: 0 -1px;  
94 border: 1px solid @border-color-base; 97 border: 1px solid @border-color-base;
95 border-top: none; 98 border-top: none;
96 border-radius: 0 0 @border-radius-base @border-radius-base; 99 border-radius: 0 0 @border-radius-base @border-radius-base;
test/routers/transfer.vue
@@ -12,9 +12,9 @@ @@ -12,9 +12,9 @@
12 :operations="['向左移动','向右移动']" 12 :operations="['向左移动','向右移动']"
13 :filter-method="filterMethod" 13 :filter-method="filterMethod"
14 @on-change="change"> 14 @on-change="change">
15 - <!--<div :style="{float: 'right', margin: '5px'}">-->  
16 - <!--<i-button type="ghost" size="small" @click="getMock">刷新</i-button>-->  
17 - <!--</div>--> 15 + <div :style="{float: 'right', margin: '5px'}">
  16 + <i-button type="ghost" size="small" @click="getMock">刷新</i-button>
  17 + </div>
18 </Transfer> 18 </Transfer>
19 </div> 19 </div>
20 </template> 20 </template>