feat: Curtain 幕帘组件支持设置 z-index

This commit is contained in:
不如摸鱼去 2024-11-10 16:52:40 +08:00
parent 330e8c7bbf
commit a1e20afef3
3 changed files with 11 additions and 3 deletions

View File

@ -107,7 +107,8 @@ function handleClose() {
| to | 幕帘图片点击链接 | string | - | - | - | | to | 幕帘图片点击链接 | string | - | - | - |
| close-position | 关闭按钮位置 | string | inset / top / bottom / top-left / top-right / bottom-left / bottom-right | inset | - | | close-position | 关闭按钮位置 | string | inset / top / bottom / top-left / top-right / bottom-left / bottom-right | inset | - |
| close-on-click-modal | 点击遮罩是否关闭 | boolean | - | false | - | | close-on-click-modal | 点击遮罩是否关闭 | boolean | - | false | - |
| hide-when-close | 是否当关闭时将弹出层隐藏display: none) | boolean | - | true | - | | hide-when-close | 是否当关闭时将弹出层隐藏display: none | boolean | - | true | - |
| z-index | 设置层级 | number | - | 10 | $LOWEST_VERSION$ |
## Events ## Events

View File

@ -1,5 +1,5 @@
import type { ExtractPropTypes } from 'vue' import type { ExtractPropTypes } from 'vue'
import { baseProps, makeBooleanProp, makeStringProp } from '../common/props' import { baseProps, makeBooleanProp, makeNumberProp, makeStringProp } from '../common/props'
export type ClosePosition = 'inset' | 'top' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' export type ClosePosition = 'inset' | 'top' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
@ -32,7 +32,13 @@ export const curtainProps = {
/** /**
* display: none) * display: none)
*/ */
hideWhenClose: makeBooleanProp(true) hideWhenClose: makeBooleanProp(true),
/**
*
* number
* 10
*/
zIndex: makeNumberProp(10)
} }
export type CurtainProps = ExtractPropTypes<typeof curtainProps> export type CurtainProps = ExtractPropTypes<typeof curtainProps>

View File

@ -6,6 +6,7 @@
position="center" position="center"
:close-on-click-modal="closeOnClickModal" :close-on-click-modal="closeOnClickModal"
:hide-when-close="hideWhenClose" :hide-when-close="hideWhenClose"
:z-index="zIndex"
@before-enter="beforeenter" @before-enter="beforeenter"
@enter="enter" @enter="enter"
@after-enter="afterenter" @after-enter="afterenter"