import{c as t,o as d,D as e}from"./index.d870aa4d.js";const n={class:"markdown-body"},a=e('
在页面顶部展示消息提示
import { createApp } from 'vue';\nimport { Notify } from '@nutui/nutui';\n\nconst app = createApp();\napp.use(Notify);\nexport default {\n mounted() {\n Notify.text('通知内容', {\n onClosed() {\n console.log('close');\n },\n onClick: () => {\n console.log('click');\n }\n });\n }\n}\n mounted(){\n Notify.primary('通知内容');\n }\n mounted(){\n Notify.success('通知内容');\n }\n mounted(){\n Notify.danger('通知内容');\n }\n mounted(){\n Notify.warn('通知内容');\n }\n mounted(){\n Notify.text(val, {\n color: '#ad0000',\n background: '#ffe1e1'\n });\n }\n mounted(){\n Notify.text(val, {\n duration: 10000\n });\n }\n| 字段 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| type | 提示的信息 | String | 空 |
| message | 展示文案,支持通过\\n换行 | Boolean | false |
| duration | 展示时长(ms),值为 0 时,notify 不会消失 | String | 空 |
| color | 字体颜色 | String | 空 |
| background | 背景颜色 | String | 空 |
| class-name | 自定义类名 | String/Number | 1 |
| 事件名 | 说明 | 回调参数 |
|---|---|---|
| on-click | 点击事件回调 | 无 |
| on-close | 关闭事件回调 | 无 |