Commit 3f611f57eda174c69397c951eb8105f51891df1c
1 parent
0c9f8fab
Collapse add simple prop
Showing
4 changed files
with
25 additions
and
4 deletions
Show diff stats
examples/routers/collapse.vue
1 | 1 | <template> |
2 | 2 | <div> |
3 | - <Collapse accordion v-model="value3"> | |
3 | + <Collapse accordion v-model="value3" simple> | |
4 | 4 | <Panel name="1" hide-arrow> |
5 | 5 | 史蒂夫·乔布斯 |
6 | 6 | <div slot="content"> |
... | ... | @@ -29,7 +29,7 @@ |
29 | 29 | |
30 | 30 | <br/> |
31 | 31 | <br/> |
32 | - <Collapse v-model="value5"> | |
32 | + <Collapse v-model="value5" simple> | |
33 | 33 | <Panel name="21"> |
34 | 34 | 斯蒂夫·盖瑞·沃兹尼亚克 |
35 | 35 | <p slot="content">斯蒂夫·盖瑞·沃兹尼亚克(Stephen Gary Wozniak),美国电脑工程师,曾与史蒂夫·乔布斯合伙创立苹果电脑(今之苹果公司)。斯蒂夫·盖瑞·沃兹尼亚克曾就读于美国科罗拉多大学,后转学入美国著名高等学府加州大学伯克利分校(UC Berkeley)并获得电机工程及计算机(EECS)本科学位(1987年)。</p> | ... | ... |
src/components/collapse/collapse.vue
... | ... | @@ -15,6 +15,10 @@ |
15 | 15 | }, |
16 | 16 | value: { |
17 | 17 | type: [Array, String] |
18 | + }, | |
19 | + simple: { | |
20 | + type: Boolean, | |
21 | + default: false | |
18 | 22 | } |
19 | 23 | }, |
20 | 24 | data () { |
... | ... | @@ -24,7 +28,12 @@ |
24 | 28 | }, |
25 | 29 | computed: { |
26 | 30 | classes () { |
27 | - return `${prefixCls}`; | |
31 | + return [ | |
32 | + `${prefixCls}`, | |
33 | + { | |
34 | + [`${prefixCls}-simple`]: this.simple | |
35 | + } | |
36 | + ]; | |
28 | 37 | } |
29 | 38 | }, |
30 | 39 | mounted () { | ... | ... |
src/components/rate/rate.vue
src/styles/components/collapse.less
... | ... | @@ -5,6 +5,12 @@ |
5 | 5 | border-radius: 3px; |
6 | 6 | border: 1px solid @border-color-base; |
7 | 7 | |
8 | + &-simple{ | |
9 | + border-left: none; | |
10 | + border-right: none; | |
11 | + background-color: #fff; | |
12 | + } | |
13 | + | |
8 | 14 | & > &-item{ |
9 | 15 | border-top: 1px solid @border-color-base; |
10 | 16 | &:first-child { |
... | ... | @@ -30,6 +36,9 @@ |
30 | 36 | & > &-item&-item-active > &-header{ |
31 | 37 | border-bottom: 1px solid @border-color-base; |
32 | 38 | } |
39 | + &-simple > &-item&-item-active > &-header{ | |
40 | + border-bottom: 1px solid transparent; | |
41 | + } | |
33 | 42 | & > &-item&-item-active > &-header > i{ |
34 | 43 | transform: rotate(90deg); |
35 | 44 | } |
... | ... | @@ -46,6 +55,9 @@ |
46 | 55 | padding-bottom: 16px; |
47 | 56 | } |
48 | 57 | } |
58 | + &-simple > &-item > &-content > &-content-box{ | |
59 | + padding-top: 0; | |
60 | + } | |
49 | 61 | &-item-active > &-content{ |
50 | 62 | //display: block; |
51 | 63 | } | ... | ... |