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