diff --git a/packages/vant/src/notify/Notify.tsx b/packages/vant/src/notify/Notify.tsx index 9007e2979..93356bd2a 100644 --- a/packages/vant/src/notify/Notify.tsx +++ b/packages/vant/src/notify/Notify.tsx @@ -43,6 +43,7 @@ export default defineComponent({ background: props.background, }} overlay={false} + zIndex={props.zIndex} position={props.position} duration={0.2} lockScroll={props.lockScroll} diff --git a/packages/vant/src/notify/README.md b/packages/vant/src/notify/README.md index 8233e8f1a..29d985b51 100644 --- a/packages/vant/src/notify/README.md +++ b/packages/vant/src/notify/README.md @@ -127,6 +127,7 @@ Vant exports following Notify utility functions: | type | Can be set to `primary` `success` `warning` | _NotifyType_ | `danger` | | message | Message | _string_ | - | | duration | Duration(ms), won't disappear if value is 0 | _number \| string_ | `3000` | +| z-index | Set the z-index to a fixed value | _number \| string_ | `2000+` | | position `v3.4.0` | Position, can be set to `bottom` | _NotifyPosition_ | `top` | | color | Message color | _string_ | `white` | | background | Background color | _string_ | - | diff --git a/packages/vant/src/notify/README.zh-CN.md b/packages/vant/src/notify/README.zh-CN.md index 84a9f7eff..68b4598fb 100644 --- a/packages/vant/src/notify/README.zh-CN.md +++ b/packages/vant/src/notify/README.zh-CN.md @@ -142,6 +142,7 @@ Vant 中导出了以下 Notify 相关的辅助函数: | type | 类型,可选值为 `primary` `success` `warning` | _NotifyType_ | `danger` | | message | 展示文案,支持通过`\n`换行 | _string_ | - | | duration | 展示时长(ms),值为 0 时,notify 不会消失 | _number \| string_ | `3000` | +| z-index | 将组件的 z-index 层级设置为一个固定值 | _number \| string_ | `2000+` | | position `v3.4.0` | 弹出位置,可选值为 `bottom` | _NotifyPosition_ | `top` | | color | 字体颜色 | _string_ | `white` | | background | 背景颜色 | _string_ | - |