mirror of
https://gitee.com/dapppp/ruoyi-plus-vben5.git
synced 2026-03-08 07:31:09 +08:00
fix(notification): 限制全局消息最大显示数量为1
修复通知组件在多次触发时可能显示多条消息的问题,通过配置 message prop 的 maxCount 参数确保始终只显示最新的一条通知消息
This commit is contained in:
@@ -59,7 +59,7 @@ const otherProps = computed<
|
||||
:wave="waveConfig"
|
||||
v-bind="otherProps"
|
||||
>
|
||||
<App>
|
||||
<App :message="{ maxCount: 1 }">
|
||||
<RouterView />
|
||||
<PopupContext />
|
||||
</App>
|
||||
|
||||
@@ -76,6 +76,10 @@ function handleClick() {
|
||||
}
|
||||
|
||||
const loading = ref(true);
|
||||
|
||||
function keepOneMessage() {
|
||||
window.message.success('只有一条消息');
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -84,7 +88,15 @@ const loading = ref(true);
|
||||
<template #message>
|
||||
该分支使用antdv-next替代不维护的ant-design-vue
|
||||
<a-button class="ml-2" size="small" type="primary" @click="handleClick">
|
||||
疯狂点击
|
||||
新的 notification 样式
|
||||
</a-button>
|
||||
<a-button
|
||||
class="ml-2"
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="keepOneMessage"
|
||||
>
|
||||
保持一条消息
|
||||
</a-button>
|
||||
</template>
|
||||
</Alert>
|
||||
|
||||
Reference in New Issue
Block a user