We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More convenient configuration and operation
duration
maxVisible
placement
topRight
bottomRight
bottomLeft
topLeft
<!-- App.vue --> <n-message-provider :duration="3" :maxVisible="1"> <content /> </n-message-provider> <n-notification-provider :duration="3" placement="bottomRight"> <content /> </n-notification-provider>
destroyAll()
// vue-router guard import type { Router } from "vue-router"; import { useMessage, useNotification } from "naive-ui"; const message = useMessage(); const notification= useNotification(); export default function messageGuard(router: Router) { router.beforeEach(() => { try { message.destroyAll(); notification.destroyAll(); } catch (error) { console.error("message guard error:" error); } return true; }); }
The text was updated successfully, but these errors were encountered:
只解决了message的个别配置,notification的呢?destroyAll呢?咋就给关了
Sorry, something went wrong.
Notification 的话 placement 计划搞,不过 maxVisible 和 duration 没有计划
Fnzero
Successfully merging a pull request may close this issue.
This function solves the problem (这个功能解决的问题)
More convenient configuration and operation
Expected API (期望的 API)
global configuration
duration
maxVisible
: The maximum number of messages to be displayed beyond the automatic closing time for earlier messagesplacement
: notification pop up fromtopRight
orbottomRight
orbottomLeft
ortopLeft
.global events
destroyAll()
: destroy allThe text was updated successfully, but these errors were encountered: