Ver código fonte

dropdown split button prop size

baiyaaaaa 8 anos atrás
pai
commit
d8eebafbdc

+ 2 - 1
examples/docs/zh-cn/dropdown.md

@@ -152,7 +152,8 @@
 ### Attributes
 | 参数          | 说明            | 类型            | 可选值                 | 默认值   |
 |-------------  |---------------- |---------------- |---------------------- |-------- |
-| type          | 菜单按钮类型,同 Button 组件   | string  |          —             |    —     |
+| type          | 菜单按钮类型,同 Button 组件(只在`split-button`为 true 的情况下有效)   | string  |          —             |    —     |
+| size          | 菜单按钮尺寸,同 Button 组件(只在`split-button`为 true 的情况下有效)     | string          | hover, click  | hover |
 | split-button  | 下拉触发元素呈现为按钮组    | boolean  |    —  |  false |
 | menu-align    | 菜单水平对齐方向     | string          | start, end  | end |
 | trigger       | 触发下拉的行为     | string          | hover, click  | hover |

+ 5 - 6
packages/dropdown/src/dropdown.vue

@@ -18,9 +18,8 @@
         type: String,
         default: 'end'
       },
-      type: {
-        type: String
-      },
+      type: String,
+      size: String,
       splitButton: Boolean
     },
 
@@ -83,7 +82,7 @@
     },
 
     render(h) {
-      let { hide, splitButton, type } = this;
+      let { hide, splitButton, type, size } = this;
 
       var handleClick = _ => {
         this.$emit('click');
@@ -92,10 +91,10 @@
       let triggerElm = !splitButton
         ? this.$slots.default
         : (<el-button-group>
-            <el-button type={type} nativeOn-click={handleClick}>
+            <el-button type={type} size={size} nativeOn-click={handleClick}>
               {this.$slots.default}
             </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>
             </el-button>
           </el-button-group>);