Commit f180098687d7fdb2d01f4f1b7d3519518940ff33
1 parent
82151bd9
update Dropdown cls
Showing
3 changed files
with
11 additions
and
0 deletions
Show diff stats
examples/routers/select.vue
@@ -95,6 +95,7 @@ | @@ -95,6 +95,7 @@ | ||
95 | v-model="model13" | 95 | v-model="model13" |
96 | filterable | 96 | filterable |
97 | remote | 97 | remote |
98 | + transfer | ||
98 | :remote-method="remoteMethod1" | 99 | :remote-method="remoteMethod1" |
99 | :loading="loading1"> | 100 | :loading="loading1"> |
100 | <Option v-for="(option, index) in options1" :value="option.value" :key="index">{{option.label}}</Option> | 101 | <Option v-for="(option, index) in options1" :value="option.value" :key="index">{{option.label}}</Option> |
src/components/dropdown/dropdown.vue
@@ -7,6 +7,7 @@ | @@ -7,6 +7,7 @@ | ||
7 | <div :class="[prefixCls + '-rel']" ref="reference" @click="handleClick"><slot></slot></div> | 7 | <div :class="[prefixCls + '-rel']" ref="reference" @click="handleClick"><slot></slot></div> |
8 | <transition :name="transition"> | 8 | <transition :name="transition"> |
9 | <Drop | 9 | <Drop |
10 | + :class="dropdownCls" | ||
10 | v-show="currentVisible" | 11 | v-show="currentVisible" |
11 | :placement="placement" | 12 | :placement="placement" |
12 | ref="drop" | 13 | ref="drop" |
@@ -54,6 +55,11 @@ | @@ -54,6 +55,11 @@ | ||
54 | computed: { | 55 | computed: { |
55 | transition () { | 56 | transition () { |
56 | return ['bottom-start', 'bottom', 'bottom-end'].indexOf(this.placement) > -1 ? 'slide-up' : 'fade'; | 57 | return ['bottom-start', 'bottom', 'bottom-end'].indexOf(this.placement) > -1 ? 'slide-up' : 'fade'; |
58 | + }, | ||
59 | + dropdownCls () { | ||
60 | + return { | ||
61 | + [prefixCls + '-transfer']: this.transfer | ||
62 | + }; | ||
57 | } | 63 | } |
58 | }, | 64 | }, |
59 | data () { | 65 | data () { |
src/styles/components/dropdown.less
@@ -21,6 +21,10 @@ | @@ -21,6 +21,10 @@ | ||
21 | &-menu{ | 21 | &-menu{ |
22 | min-width: 100px; | 22 | min-width: 100px; |
23 | } | 23 | } |
24 | + | ||
25 | + &-transfer{ | ||
26 | + width: auto; | ||
27 | + } | ||
24 | } | 28 | } |
25 | 29 | ||
26 | .select-item(@dropdown-prefix-cls, @dropdown-item-prefix-cls); | 30 | .select-item(@dropdown-prefix-cls, @dropdown-item-prefix-cls); |
27 | \ No newline at end of file | 31 | \ No newline at end of file |