mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-24 02:16:12 +08:00
[new feature] DropdownMenu: add close-on-click-overlay prop
This commit is contained in:
parent
df7d33b03d
commit
6832fd8640
@ -39,7 +39,7 @@ export default sfc({
|
|||||||
},
|
},
|
||||||
|
|
||||||
render(h) {
|
render(h) {
|
||||||
const { top, zIndex, activeColor } = this.parent;
|
const { top, zIndex, overlay, activeColor, closeOnClickOverlay } = this.parent;
|
||||||
|
|
||||||
const Options = this.options.map(option => {
|
const Options = this.options.map(option => {
|
||||||
const active = option.value === this.value;
|
const active = option.value === this.value;
|
||||||
@ -65,7 +65,8 @@ export default sfc({
|
|||||||
position="top"
|
position="top"
|
||||||
duration={0.2}
|
duration={0.2}
|
||||||
class={bem('content')}
|
class={bem('content')}
|
||||||
overlay={this.parent.overlay}
|
overlay={overlay}
|
||||||
|
closeOnClickOverlay={closeOnClickOverlay}
|
||||||
overlayStyle={{ position: 'absolute' }}
|
overlayStyle={{ position: 'absolute' }}
|
||||||
>
|
>
|
||||||
{Options}
|
{Options}
|
||||||
|
@ -83,6 +83,7 @@ export default {
|
|||||||
| active-color | Active color of title and option | `String` | `#1989fa` |
|
| active-color | Active color of title and option | `String` | `#1989fa` |
|
||||||
| z-index | z-index of menu item | `Number` | `10` |
|
| z-index | z-index of menu item | `Number` | `10` |
|
||||||
| overlay | Whether to show overlay | `Boolean` | `true` |
|
| overlay | Whether to show overlay | `Boolean` | `true` |
|
||||||
|
| close-on-click-overlay | Whether to close when click overlay | `Boolean` | `true` |
|
||||||
|
|
||||||
### DropdownItem Props
|
### DropdownItem Props
|
||||||
|
|
||||||
|
@ -19,6 +19,10 @@ export default sfc({
|
|||||||
activeColor: {
|
activeColor: {
|
||||||
type: String,
|
type: String,
|
||||||
default: BLUE
|
default: BLUE
|
||||||
|
},
|
||||||
|
closeOnClickOverlay: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -84,7 +84,8 @@ export default {
|
|||||||
|------|------|------|------|------|
|
|------|------|------|------|------|
|
||||||
| active-color | 菜单标题和选项的选中态颜色 | `String` | `#1989fa` | - |
|
| active-color | 菜单标题和选项的选中态颜色 | `String` | `#1989fa` | - |
|
||||||
| z-index | 菜单栏 z-index 层级 | `Number` | `10` | - |
|
| z-index | 菜单栏 z-index 层级 | `Number` | `10` | - |
|
||||||
| overlay | 是否显示遮罩层 | `Boolean` | `true` | - | - |
|
| overlay | 是否显示遮罩层 | `Boolean` | `true` | - |
|
||||||
|
| close-on-click-overlay | 是否在点击蒙层后关闭菜单 | `Boolean` | `true` | - |
|
||||||
|
|
||||||
### DropdownItem Props
|
### DropdownItem Props
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user