Commit 0e4166bd0a1694a1735d6738e7c6763fd5d2084d
1 parent
8a392d25
fixed #1728
Showing
2 changed files
with
15 additions
and
60 deletions
Show diff stats
examples/routers/cascader.vue
| 1 | <template> | 1 | <template> |
| 2 | - <div style="margin: 100px;width: 200px;"> | ||
| 3 | - {{ value }} | ||
| 4 | - <Cascader v-model="value" :data="data" change-on-select></Cascader> | ||
| 5 | - <Button @click="change">change</Button> | 2 | + <div style="width: 200px;margin: 100px;"> |
| 3 | + <Cascader :data="data" v-model="value1"></Cascader> | ||
| 6 | </div> | 4 | </div> |
| 7 | </template> | 5 | </template> |
| 8 | <script> | 6 | <script> |
| 9 | export default { | 7 | export default { |
| 10 | data () { | 8 | data () { |
| 11 | return { | 9 | return { |
| 12 | - value: [], | 10 | + value1: [], |
| 13 | data: [{ | 11 | data: [{ |
| 14 | value: 'beijing', | 12 | value: 'beijing', |
| 15 | label: '北京', | 13 | label: '北京', |
| @@ -58,61 +56,6 @@ | @@ -58,61 +56,6 @@ | ||
| 58 | ], | 56 | ], |
| 59 | }] | 57 | }] |
| 60 | } | 58 | } |
| 61 | - }, | ||
| 62 | - methods: { | ||
| 63 | - change () { | ||
| 64 | - this.data = [{ | ||
| 65 | - value: 'beijing2', | ||
| 66 | - label: '北京', | ||
| 67 | - children: [ | ||
| 68 | - { | ||
| 69 | - value: 'gugong2', | ||
| 70 | - label: '故宫' | ||
| 71 | - }, | ||
| 72 | - { | ||
| 73 | - value: 'tiantan2', | ||
| 74 | - label: '天坛' | ||
| 75 | - }, | ||
| 76 | - { | ||
| 77 | - value: 'wangfujing2', | ||
| 78 | - label: '王府井' | ||
| 79 | - } | ||
| 80 | - ] | ||
| 81 | - }, { | ||
| 82 | - value: 'jiangsu2', | ||
| 83 | - label: '江苏', | ||
| 84 | - children: [ | ||
| 85 | - { | ||
| 86 | - value: 'nanjing2', | ||
| 87 | - label: '南京', | ||
| 88 | - children: [ | ||
| 89 | - { | ||
| 90 | - value: 'fuzimiao2', | ||
| 91 | - label: '夫子庙', | ||
| 92 | - } | ||
| 93 | - ] | ||
| 94 | - }, | ||
| 95 | - { | ||
| 96 | - value: 'suzhou2', | ||
| 97 | - label: '苏州', | ||
| 98 | - children: [ | ||
| 99 | - { | ||
| 100 | - value: 'zhuozhengyuan2', | ||
| 101 | - label: '拙政园', | ||
| 102 | - }, | ||
| 103 | - { | ||
| 104 | - value: 'shizilin2', | ||
| 105 | - label: '狮子林', | ||
| 106 | - } | ||
| 107 | - ] | ||
| 108 | - } | ||
| 109 | - ], | ||
| 110 | - }]; | ||
| 111 | - | ||
| 112 | - this.$nextTick(() => { | ||
| 113 | - this.value = ['beijing2', 'tiantan2']; | ||
| 114 | - }); | ||
| 115 | - } | ||
| 116 | } | 59 | } |
| 117 | } | 60 | } |
| 118 | </script> | 61 | </script> |
src/styles/components/cascader.less
| @@ -149,6 +149,18 @@ | @@ -149,6 +149,18 @@ | ||
| 149 | .ivu-select-item span{ | 149 | .ivu-select-item span{ |
| 150 | color: @error-color; | 150 | color: @error-color; |
| 151 | } | 151 | } |
| 152 | + .@{cascader-prefix-cls} { | ||
| 153 | + &-menu{ | ||
| 154 | + &-item{ | ||
| 155 | + padding-right: 24px; | ||
| 156 | + transition: all @transition-time @ease-in-out; | ||
| 157 | + &-active{ | ||
| 158 | + background-color: @background-color-select-hover; | ||
| 159 | + color: @primary-color; | ||
| 160 | + } | ||
| 161 | + } | ||
| 162 | + } | ||
| 163 | + } | ||
| 152 | } | 164 | } |
| 153 | 165 | ||
| 154 | .@{form-item-prefix-cls}-error{ | 166 | .@{form-item-prefix-cls}-error{ |