[new feature] DropdownMenu: add close-on-click-overlay prop

This commit is contained in:
陈嘉涵 2019-05-07 20:43:59 +08:00
parent df7d33b03d
commit 6832fd8640
4 changed files with 10 additions and 3 deletions

View File

@ -39,7 +39,7 @@ export default sfc({
},
render(h) {
const { top, zIndex, activeColor } = this.parent;
const { top, zIndex, overlay, activeColor, closeOnClickOverlay } = this.parent;
const Options = this.options.map(option => {
const active = option.value === this.value;
@ -65,7 +65,8 @@ export default sfc({
position="top"
duration={0.2}
class={bem('content')}
overlay={this.parent.overlay}
overlay={overlay}
closeOnClickOverlay={closeOnClickOverlay}
overlayStyle={{ position: 'absolute' }}
>
{Options}

View File

@ -83,6 +83,7 @@ export default {
| active-color | Active color of title and option | `String` | `#1989fa` |
| z-index | z-index of menu item | `Number` | `10` |
| overlay | Whether to show overlay | `Boolean` | `true` |
| close-on-click-overlay | Whether to close when click overlay | `Boolean` | `true` |
### DropdownItem Props

View File

@ -19,6 +19,10 @@ export default sfc({
activeColor: {
type: String,
default: BLUE
},
closeOnClickOverlay: {
type: Boolean,
default: true
}
},

View File

@ -84,7 +84,8 @@ export default {
|------|------|------|------|------|
| active-color | 菜单标题和选项的选中态颜色 | `String` | `#1989fa` | - |
| z-index | 菜单栏 z-index 层级 | `Number` | `10` | - |
| overlay | 是否显示遮罩层 | `Boolean` | `true` | - | - |
| overlay | 是否显示遮罩层 | `Boolean` | `true` | - |
| close-on-click-overlay | 是否在点击蒙层后关闭菜单 | `Boolean` | `true` | - |
### DropdownItem Props