Commit 5722a6fb91700a246221fdb6a331416fc3022f80
1 parent
a404bbae
RadioGroup add vertical props
RadioGroup add vertical props
Showing
4 changed files
with
20 additions
and
10 deletions
Show diff stats
src/components/radio/radio-group.vue
@@ -24,6 +24,10 @@ | @@ -24,6 +24,10 @@ | ||
24 | validator (value) { | 24 | validator (value) { |
25 | return oneOf(value, ['button']); | 25 | return oneOf(value, ['button']); |
26 | } | 26 | } |
27 | + }, | ||
28 | + vertical: { | ||
29 | + type: Boolean, | ||
30 | + default: false | ||
27 | } | 31 | } |
28 | }, | 32 | }, |
29 | computed: { | 33 | computed: { |
@@ -32,7 +36,8 @@ | @@ -32,7 +36,8 @@ | ||
32 | `${prefixCls}`, | 36 | `${prefixCls}`, |
33 | { | 37 | { |
34 | [`${prefixCls}-${this.size}`]: !!this.size, | 38 | [`${prefixCls}-${this.size}`]: !!this.size, |
35 | - [`${prefixCls}-${this.type}`]: !!this.type | 39 | + [`${prefixCls}-${this.type}`]: !!this.type, |
40 | + [`${prefixCls}-vertical`]: this.vertical | ||
36 | } | 41 | } |
37 | ]; | 42 | ]; |
38 | } | 43 | } |
src/styles/components/radio.less
@@ -6,6 +6,13 @@ | @@ -6,6 +6,13 @@ | ||
6 | .@{radio-group-prefix-cls} { | 6 | .@{radio-group-prefix-cls} { |
7 | display: inline-block; | 7 | display: inline-block; |
8 | font-size: @font-size-small; | 8 | font-size: @font-size-small; |
9 | + &-vertical{ | ||
10 | + .@{radio-prefix-cls}-wrapper { | ||
11 | + display: block; | ||
12 | + height: 30px; | ||
13 | + line-height: 30px; | ||
14 | + } | ||
15 | + } | ||
9 | } | 16 | } |
10 | 17 | ||
11 | // 普通状态 | 18 | // 普通状态 |
@@ -16,6 +23,10 @@ | @@ -16,6 +23,10 @@ | ||
16 | position: relative; | 23 | position: relative; |
17 | white-space: nowrap; | 24 | white-space: nowrap; |
18 | margin-right: 8px; | 25 | margin-right: 8px; |
26 | + cursor: pointer; | ||
27 | + &-disabled{ | ||
28 | + cursor: @cursor-disabled; | ||
29 | + } | ||
19 | } | 30 | } |
20 | 31 | ||
21 | .@{radio-prefix-cls} { | 32 | .@{radio-prefix-cls} { |
test/routers/radio.vue
1 | <template> | 1 | <template> |
2 | <div> | 2 | <div> |
3 | - <Checkbox>hello</Checkbox> | ||
4 | - <Radio-group :model.sync="phone"> | 3 | + <Radio-group :model.sync="phone" vertical> |
5 | <Radio value="apple"> | 4 | <Radio value="apple"> |
6 | <Icon type="social-apple"></Icon> | 5 | <Icon type="social-apple"></Icon> |
7 | <span>Apple</span> | 6 | <span>Apple</span> |
@@ -27,7 +26,7 @@ | @@ -27,7 +26,7 @@ | ||
27 | <i-button @click="radio = !radio">change radio</i-button> | 26 | <i-button @click="radio = !radio">change radio</i-button> |
28 | <br> | 27 | <br> |
29 | <br> | 28 | <br> |
30 | - <Radio-group :model.sync="phone" type="button"> | 29 | + <Radio-group :model.sync="phone" type="button" vertical> |
31 | <Radio value="apple"> | 30 | <Radio value="apple"> |
32 | <Icon type="social-apple"></Icon> | 31 | <Icon type="social-apple"></Icon> |
33 | <span>Apple</span> | 32 | <span>Apple</span> |
test/routers/table.vue
1 | -<style> | ||
2 | - body{ | ||
3 | - overflow: hidden; | ||
4 | - } | ||
5 | -</style> | ||
6 | <template> | 1 | <template> |
7 | <i-table border :columns="columns1" :data="data1"></i-table> | 2 | <i-table border :columns="columns1" :data="data1"></i-table> |
8 | - <i-table border height="200" :columns="columns1" :data="data2"></i-table> | 3 | + <!--<i-table border height="200" :columns="columns1" :data="data2"></i-table>--> |
9 | <!--<i-table width="550" height="200" border :columns="columns2" :data="data4"></i-table>--> | 4 | <!--<i-table width="550" height="200" border :columns="columns2" :data="data4"></i-table>--> |
10 | <!--<i-button @click="changeFilter">改变filter</i-button>--> | 5 | <!--<i-button @click="changeFilter">改变filter</i-button>--> |
11 | <!--<span v-if="currentRow !== null">Current Row: {{currentRow.name}}</span>--> | 6 | <!--<span v-if="currentRow !== null">Current Row: {{currentRow.name}}</span>--> |