mirror of https://github.com/ElemeFE/element
commit
ba27ca55d4
|
@ -152,7 +152,8 @@
|
||||||
### Attributes
|
### Attributes
|
||||||
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
||||||
|------------- |---------------- |---------------- |---------------------- |-------- |
|
|------------- |---------------- |---------------- |---------------------- |-------- |
|
||||||
| type | 菜单按钮类型,同 Button 组件 | string | — | — |
|
| type | 菜单按钮类型,同 Button 组件(只在`split-button`为 true 的情况下有效) | string | — | — |
|
||||||
|
| size | 菜单按钮尺寸,同 Button 组件(只在`split-button`为 true 的情况下有效) | string | hover, click | hover |
|
||||||
| split-button | 下拉触发元素呈现为按钮组 | boolean | — | false |
|
| split-button | 下拉触发元素呈现为按钮组 | boolean | — | false |
|
||||||
| menu-align | 菜单水平对齐方向 | string | start, end | end |
|
| menu-align | 菜单水平对齐方向 | string | start, end | end |
|
||||||
| trigger | 触发下拉的行为 | string | hover, click | hover |
|
| trigger | 触发下拉的行为 | string | hover, click | hover |
|
||||||
|
|
|
@ -18,9 +18,8 @@
|
||||||
type: String,
|
type: String,
|
||||||
default: 'end'
|
default: 'end'
|
||||||
},
|
},
|
||||||
type: {
|
type: String,
|
||||||
type: String
|
size: String,
|
||||||
},
|
|
||||||
splitButton: Boolean
|
splitButton: Boolean
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -83,7 +82,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
render(h) {
|
render(h) {
|
||||||
let { hide, splitButton, type } = this;
|
let { hide, splitButton, type, size } = this;
|
||||||
|
|
||||||
var handleClick = _ => {
|
var handleClick = _ => {
|
||||||
this.$emit('click');
|
this.$emit('click');
|
||||||
|
@ -92,10 +91,10 @@
|
||||||
let triggerElm = !splitButton
|
let triggerElm = !splitButton
|
||||||
? this.$slots.default
|
? this.$slots.default
|
||||||
: (<el-button-group>
|
: (<el-button-group>
|
||||||
<el-button type={type} nativeOn-click={handleClick}>
|
<el-button type={type} size={size} nativeOn-click={handleClick}>
|
||||||
{this.$slots.default}
|
{this.$slots.default}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button ref="trigger" type={type} class="el-dropdown__icon-button">
|
<el-button ref="trigger" type={type} size={size} class="el-dropdown__icon-button">
|
||||||
<i class="el-dropdown__icon el-icon-caret-bottom"></i>
|
<i class="el-dropdown__icon el-icon-caret-bottom"></i>
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-button-group>);
|
</el-button-group>);
|
||||||
|
|
Loading…
Reference in New Issue