函数式调用
+标签式调用
+函数式调用
+标签式调用
+test
-test
-显示、关闭事件
-确认、取消事件
-关闭点击事件
-缩放事件
-显示、关闭事件
-确认、取消事件
-关闭点击事件
-缩放事件
-函数式调用
+标签式调用
+函数式调用
+标签式调用
+函数式调用
+标签式调用
+函数式调用
+标签式调用
+函数式调用
+标签式调用
+#foot 插槽
+函数式调用
+标签式调用
+#foot 插槽
+函数式调用
+标签式调用
+函数式调用
+标签式调用
+需要为body添加滚动条之后,再验证锁定功能
+函数式调用
+标签式调用
+需要为body添加滚动条之后,再验证锁定功能
+函数式调用
+标签式调用
+函数式调用
+标签式调用
+函数式调用
+标签式调用
+函数式调用
+标签式调用
+函数式调用
+标签式调用
+函数式调用
+标签式调用
+函数式调用
+标签式调用
+函数式调用
+标签式调用
+函数式调用
+标签式调用
+模态窗状态:
+消息状态:
+标签式调用:
+模态窗状态:
+消息状态:
+标签式调用:
+test
- -test
- -可通过Modal.alert
方法设置弹出框,Modal.confirm
方法设置确认弹出框。函数返回一个Promise
对象,其中属性vm
可用来关闭当前模态框。
You can use the Modal.alert
method to set a pop-up box, and use the Modal.confirm
method to set a confirmation pop-up box. The function returns a Promise
object, where the property vm
can be used to close the current Modal.
Modal
组件有2种调用方法:函数式调用
和标签式调用
。 +
函数式调用
+ 通过调用Modal
对象下的 alert
、confirm
、message
方法调用弹窗组件。 + 函数入参:支持
(message:string, title:string, options: Object)
或 (options: Object)
两种形式。
+ 其中 options
对象支持Modal
组件的部分属性值,比如 message, title, status
等。 + 函数返回:返回值为一个
Promise
对象,其中属性vm
可用来关闭当前模态框+
标签式调用
+Modal
对象自身也是一个标准的Vue 组件,通过modelValue
属性控制弹窗的显示和隐藏。
+ 特别提示:
+ 1、message
的消息模式,只支持函数式调用。+ 2、消息模式和模态窗模式很多属性不共用,比如消息模式就不支持
title
等属性。
+ Modal
component has two calls: the function call
and the tag call
. +
Function call
+ You can do this by calling thealert
, confirm
, and message
methods under the Modal
object. + Function entry: Support
(message:string, title:string, options: Object)
or (options: Object)
two forms.
+ The options
object supports some property values of the Modal
component, such as message, title, status
and so on. + Function return: The return value is a
Promise
object where the property vm
can be used to close the current mode box +
Tag call
+ TheModal
object itself is also a standard Vue component that controls the display and hiding of pop-ups through the modelValue
property.
+ Special note:
+ 1,message
message mode, only support functional call. + 2, message mode and mode window mode many attributes do not share, for example, message mode does not support
title
and other attributes.
+ 可通过fullscreen
属性设置是否最大化显示。
You can use the fullscreen
attribute to set whether to maximize the display.
可通过esc-closable
属性设置是否允许按 Esc 键关闭窗口。
You can use the esc-closable
attribute to set whether to close a window by pressing the Esc key.
可通过duration
属性设置自动关闭的延迟时间,仅当type='message'
有效。
You can use the duration
attribute to set the delay time for automatic closing. This parameter is valid only for type=message.
可通过id
设置防止重复提示,仅当type='message'
有效。
If you do not want to click the window repeatedly, you can set a unique id
to prevent repeated prompts. This parameter is valid only for type=message.
可通过lock-scroll
属性设置是否锁住滚动条,不允许页面滚动。
You can use the lock-scroll
attribute to set whether to lock the scroll bar.
可通过mask
属性设置是否显示遮罩层,lock-view
属性设置是否锁住页面,不允许窗口之外的任何操作。
status
属性设置组件状态,可选值有info
、success
、warning
、error
、loading
,每种状态有相应的状态图标。',
'en-US':
- 'You can set whether to display the mask layer through themask
attribute, and whether to lock the page and not allow any operations outside the window through thelock-view
attribute'
+ 'Use the status
property to set the component state, Optional values are info
, success
, warning
, error
, and loading
. Each state has a corresponding status icon.'
},
- codeFiles: ['lock-view.vue']
+ codeFiles: ['status.vue']
},
+
{
- demoId: 'mask-closable',
+ demoId: 'modal-header',
name: {
- 'zh-CN': '点击遮罩层关闭窗口',
- 'en-US': 'Click The Mask Layer To Close The Window.'
+ 'zh-CN': '自定义弹窗标题',
+ 'en-US': 'Custom Modal title'
},
desc: {
- 'zh-CN': '可通过mask-closable
属性设置是否允许点击遮罩层关闭窗口。
You can use the mask-closable
attribute to set whether to allow clicking the mask layer to close the window.
show-header
属性,设置是否显示头部。默认值为:true
+ 通过
title
属性,设置窗口的标题。+ `, + 'en-US': ` + Use the
show-header
property to set whether to display headers. The default value is true
+ Set the title of the window through the
title
property. + ` + }, + codeFiles: ['modal-header.vue'] }, { - demoId: 'message', + demoId: 'modal-footer', name: { - 'zh-CN': '自定义内容', - 'en-US': 'Custom Content' + 'zh-CN': '自定义弹窗底部', + 'en-US': 'Custom modal bottom' }, desc: { - 'zh-CN': '
可通过message
属性设置窗口的内容。
You can set the content of the window through the :message
attribute.
show-footer
属性设置是否显示底部。默认值为:false
+ 通过
confirm-content
属性,修改确认按钮文字;cancel-content
属性,修改取消按钮文字。+ 通过
confirm-btn-props
属性,修改确认按钮的属性;cancel-btn-props
属性,修改取消按钮的属性。+ 通过
footerDragable
属性,让底部也支持拖动(默认只有标题栏可拖动)。默认值为:false
+ 通过
#footer
插槽,完全自定义底部内容。+ `, + 'en-US': ` + Use the
show-footer
property to set whether the bottom is displayed. The default value is false
+ Modify the confirmation button text by using the
confirm-content
property; The cancer-content
property modifies the cancel button text. + The
confirm-btn-props
property is used to modify the properties of the confirm button. cancer-btn-props
property to modify the properties of the cancel button. + Use the
footerDragable
property to make the bottom also dragable (by default, only the title bar can be dragged). The default value is false
+ Completely customize the bottom content via the
#footer
slot. + ` + }, + codeFiles: ['modal-footer.vue'] }, + { - demoId: 'footer-btn-content', + demoId: 'modal-size', name: { - 'zh-CN': '自定义底部按钮内容', - 'en-US': 'Custom Bottom Button Content' + 'zh-CN': '弹窗大小/全屏', + 'en-US': 'Size control' }, desc: { - 'zh-CN': - '
可通过confirm-content
属性设置确认按钮内容,cancel-content
属性设置取消按钮内容。
\n', - 'en-US': - '
Set the content of the confirm button throughconfirm-content
, and set the content of the cancel button through:cancel-content
.
width
属性,设置初始宽度,height
属性设置初始高度,+ 通过
fullscreen
属性,设置是否最大化显示。默认值为:false
+ `,
+ 'en-US': `
+ Use the width
property to set the width, and the height
property to set the height, + Use the
fullscreen
property to set whether to maximize the display.
+ `
+ },
+ codeFiles: ['modal-size.vue']
},
{
- demoId: 'footer-btn-props',
+ demoId: 'modal-resize',
name: {
- 'zh-CN': '自定义底部按钮',
- 'en-US': 'Customize Bottom Button'
+ 'zh-CN': '弹窗调整大小',
+ 'en-US': 'Size control'
},
desc: {
- 'zh-CN':
- '可通过confirm-btn-props
属性设置确认按钮,cancel-btn-props
属性设置取消按钮。
\n', - 'en-US': - '
Set the confirmation button via :confirm-btn-props
and the cancel button via :cancel-btn-props
.
resize
属性,设置是否允许拖动边框调整窗口大小,并且右上角显示切换最大化的按钮。+ 当
resize
属性设置为true
后,通过 min-height
属性设置拖拽后窗口的最小高度,默认值为 200.+
min-width
属性设置拖拽后窗口的最小宽度,默认值为 340。+ `, + 'en-US': ` + With the
resize
property, set whether to allow dragging the border to resize the window, and the upper right corner shows a button to maximize the switch. + When the
resize
property is set to true
, use the min-height
property to set the minimum height of the drag-and-drop window. The default is 200.+ The
min-width
property sets the minimum width of the drag-and-drop window. The default value is 340. + ` + }, + codeFiles: ['modal-resize.vue'] }, { - demoId: 'resize', + demoId: 'modal-mask', name: { - 'zh-CN': '调整窗口大小', - 'en-US': 'Resize The Window' + 'zh-CN': '弹窗的遮罩层', + 'en-US': 'Modal mask' }, desc: { - 'zh-CN': - '
可通过width
属性设置宽度,height
属性设置高度,resize
属性设置是否允许拖动调整窗口大小。
Use width
to set the width, height
to set the height, and resize
to set whether to allow dragging to resize the window.
mask
属性,设置是否显示遮罩层。默认值为true
+ 通过
mask-closable
属性,设置是否允许点击遮罩层关闭窗口。默认值为false
+ `, + 'en-US': ` + The
mask
property can be used to set whether the mask layer is displayed. The default value is true
+ You can use the
mask-closable
property to set whether to allow clicking on the mask layer to close the window. The default value is false
+ ` + }, + codeFiles: ['modal-mask.vue'] }, { - demoId: 'min-width-height', + demoId: 'modal-lock', name: { - 'zh-CN': '调整窗口后的最小宽高度', - 'en-US': 'Minimum width and height after adjusting the window' + 'zh-CN': '弹窗的锁定', + 'en-US': 'Modal lock' }, desc: { - 'zh-CN': - '
可通过resize
属性设置可拖拽属性为true
后,min-height
属性设置拖拽后窗口的最小高度,min-width
属性设置拖拽后窗口的最小宽度。
resize
property can be used to set the drag property totrue
. Themin-height
property sets the minimum height of the window after dragging, and themin-width
property sets the minimum width of the window after dragging.'
- },
- codeFiles: ['min-width-height.vue']
+ 'zh-CN': `
+ 通过lock-scroll
属性,设置是否锁住滚动条,不允许页面滚动。默认值为false
+ 通过
lock-view
属性,设置是否锁住页面,不允许窗口之外的任何操作。默认值为true
+
锁住滚动条
是指锁定body
元素上的滚动条,仅当body
有滚动条时,才有效果。+
锁住页面
是指鼠标不能操作蒙层下面的元素。+
lock-scroll
property to set whether to lock the scroll bar to prevent page scrolling. The default value is false
+ Using the
lock-view
property, you can set whether to lock the page and not allow any operations outside the window. The default value is true
+
locks the scrollbar
means to lock the scrollbar on the body
element. This only works if the body
has a scrollbar.
+ Locks the page
means that the mouse cannot manipulate the elements below the mask. +
可通过show-footer
属性设置是否显示底部,show-header
属性设置是否显示头部。
show-footer
attribute, and whether to display the head through theshow-header
attribute.'
- },
- codeFiles: ['show-header-footer.vue']
+ 'zh-CN': `
+ 通过esc-closable
属性设置是否允许按 Esc 键关闭窗口。默认值为false
+ 通过
z-index
属性设置自定义堆叠顺序。+ 通过
is-form-reset
属性,设置关闭弹窗后,是否重置数据。 默认值为true
,即关闭弹窗后重置数据。+ `, + 'en-US': ` + The
esc-closable
property sets whether to allow the Esc key to close the window. The default value is false
+ You can set a custom stack order using the
z-index
property. + You can use the
is-form-reset
property to set whether data is reset after modal is closed. The default value is true
, that is, the data is reset after the modal window is closed. + ` + }, + codeFiles: ['modal-other.vue'] }, { - demoId: 'status', + demoId: 'modal-event', name: { - 'zh-CN': '消息状态', - 'en-US': 'Position From The Top' + 'zh-CN': '弹窗的事件', + 'en-US': 'Modal event' }, desc: { - 'zh-CN': - '
可通过status
属性设置消息状态,可选值有info
、success
、warning
、error
、loading
。
Set the message status throughstatus
, with optional values includinginfo
success
warning
error
loading
.
show
事件+ 当窗口关闭时,会触发
hide
事件+ 当点击确定按钮时,会触发
confirm
事件+ 当点击取消按钮时,会触发
cancel
事件+ 当点击关闭按钮时,会触发
close
事件+ 当窗口缩放时,会触发
zoom
事件+
type = 'alert'
时,没有cancel
事件+ 2、函数式调用时,不触发
close
事件+
show
event is triggered + When the window closes, the
hide
event is triggered + When the OK button is clicked, the
confirm
event is triggered. + When the cancel button is clicked, the
cancel
event is triggered. + When the close button is clicked, the
close
event is triggered. + When the window is scaled, the
zoom
event is triggered. +
type = 'alert'
, there is no cancel
event + 2, function call, does not trigger
close
event +
可通过message-closable
属性设置消息可手动关闭。
Messages can be closed manually by setting message-closable
.
#default
, #footer
插槽,标签式时,使用标准的Vue插槽语法即可。+ 在函数式使用时,通过
slots
属性,传入相应的插槽。 #footer
插槽的作用域上下文变量有: {$modal, beforeClose,confirm,cancel}
可使用。 +
Modal
组件是直接挂载到body
上,不是在Demo
组件内部渲染的,所以jsx
引用组件时,要使用引用组件的变量,而不能使用Demo
中注册的组件名。详见示例代码
+ #default
, #footer
slots, and the standard Vue slot syntax can be used for tag mode. + When used functionally, you can pass in the corresponding slot via the
slots
attribute. < code > # footer < / code > slot context variables are: the scope of the < code > {$modal, beforeClose, confirm and cancel} < / code >. +
Modal
component is mounted directly to the body
instead of rendering inside the Demo
component, when jsx
references the component, the variable that references the component should be used. You cannot use the component name registered in Demo
. See sample code
+ #default
, #footer
slots, and the standard Vue slot syntax can be used for tag mode. + When used functionally, you can pass in the corresponding slot via the
slots
attribute. < code > # footer < / code > slot context variables are: the scope of the < code > {$modal, beforeClose, confirm and cancel} < / code >. +
Modal
component is mounted directly to the body
instead of rendering inside the Demo
component, when jsx
references the component, the variable that references the component should be used. You cannot use the component name registered in Demo
. See sample code
+ 可通过title
属性设置窗口的标题。
Set the title of the window viatitle
.
message-closable
属性设置消息可手动关闭。默认值为false
+ 通过
duration
属性设置自动关闭的延迟时间,单位为毫秒。默认值为3000 ms
+ `, + 'en-US': ` + Messages can be manually closed by setting the
message-closable
property. The default value is false
+ The
duration
property is used to set the automatic shutdown delay in milliseconds. The default value is 3000 ms
+ ` + }, + codeFiles: ['message-close.vue'] }, { - demoId: 'top', + demoId: 'message-top', name: { - 'zh-CN': '距离顶部的位置', + 'zh-CN': '消息距离顶部位置', 'en-US': 'Position from top' }, desc: { - 'zh-CN': "
可通过top
属性设置消息距离顶部的位置,仅当type='message'
有效。
Set the position of the message from the top via top
, which is only valid when type='message'
.
可通过type
属性设置窗口类型。
Set the window type via :type
.
可通过modalValue/v-model
属性设置绑定值,控制弹窗是否显示。
Bind the value through modalValue/v-model
to control whether the pop-up window is displayed.
可通过z-index
属性设置自定义堆叠顺序。
Set a custom stacking order via z-index
.
可通过is-form-reset
属性设置false
,关闭弹窗后不重置数据。
By setting theis-form-reset
attribute tofalse
, the data will not be reset after closing the pop-up window.
可通过#footer
插槽设置底部内容。
The bottom content can be set through the #footer
slot.'
+ 'zh-CN': '通过top
属性设置消息距离顶部的位置,单位为px',
+ 'en-US': `Use the top
property to set the distance from the top of the message in units of px. `
},
- codeFiles: ['footer-slot.vue']
+ codeFiles: ['message-top.vue']
},
+
{
- demoId: 'default-grid',
+ demoId: 'message-id',
name: {
- 'zh-CN': '嵌套表格',
- 'en-US': 'Nested Tables'
- },
- desc: {
- 'zh-CN': '
可通过#default
插槽设置嵌套表格组件。
#default
slot.'
- },
- codeFiles: ['default-grid.vue']
- },
- {
- demoId: 'event',
- name: {
- 'zh-CN': '事件',
- 'en-US': 'event'
+ 'zh-CN': '防止重复消息提示',
+ 'en-US': 'Prevent Repeated Prompts'
},
desc: {
- 'zh-CN':
- '\n 当窗口显示时会触发show
事件,关闭时会触发hide
事件。
\n 当窗口缩放时会触发zoom
事件。
\n 当点击确定按钮时会触发confirm
事件,点击取消按钮时触发cancel
事件。
\n 当点击关闭按钮时会触发close
事件。
\n
id
设置防止重复提示。',
+ 'en-US': 'Prevent repeated prompts with the id
setting.'
},
- codeFiles: ['event.vue']
+ codeFiles: ['message-id.vue']
},
{
- demoId: 'prop-slots',
+ demoId: 'message-event',
name: {
- 'zh-CN': '函数插槽',
- 'en-US': 'When used functionally, the slot can be set through the `slots` property'
+ 'zh-CN': '消息的事件',
+ 'en-US': 'messeage event'
},
desc: {
- 'zh-CN': '在函数式使用时,可通过slots
属性设置插槽。
slots
property.'
- },
- codeFiles: ['prop-slots.vue']
+ 'zh-CN': `
+ 当窗口显示时,会触发show
事件+ 当窗口关闭时,会触发
hide
事件+ `, + 'en-US': ` + When the window is displayed, the
show
event is triggered + When the window closes, the
hide
event is triggered + ` + }, + codeFiles: ['message-event.vue'] } ] } diff --git a/examples/sites/demos/pc/app/modal/z-index-composition-api.vue b/examples/sites/demos/pc/app/modal/z-index-composition-api.vue deleted file mode 100644 index b90bac4d6d..0000000000 --- a/examples/sites/demos/pc/app/modal/z-index-composition-api.vue +++ /dev/null @@ -1,11 +0,0 @@ - -
通知消息的标题
, + title: '通知消息的标题', message: '通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文', position: 'top-right', duration: 5000, customClass: 'my-custom-cls' }) } + +function handleClickJxs() { + Notify({ + type: 'info', + title: () =>通知消息的标题
, + message: () => ( + 通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文 + ), + position: 'top-right', + duration: 5000, + customClass: 'my-custom-cls' + }) +} diff --git a/examples/sites/demos/pc/app/notify/basic-usage.spec.ts b/examples/sites/demos/pc/app/notify/basic-usage.spec.ts index 0a5cc39737..1958724326 100644 --- a/examples/sites/demos/pc/app/notify/basic-usage.spec.ts +++ b/examples/sites/demos/pc/app/notify/basic-usage.spec.ts @@ -3,10 +3,11 @@ import { test, expect } from '@playwright/test' test('基本用法', async ({ page }) => { page.on('pageerror', (exception) => expect(exception).toBeNull()) await page.goto('notify#basic-usage') - await page.getByRole('button', { name: '弹出提示框' }).click() + const status = page.locator('.tiny-notify__icon-status') + + await page.getByRole('button', { name: '弹出提示框' }).first().click() await expect(status).toBeVisible() - await expect(page.getByRole('heading', { name: '通知消息的标题' })).toBeVisible() await expect( page.getByText('通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文') ).toBeVisible() diff --git a/examples/sites/demos/pc/app/notify/basic-usage.vue b/examples/sites/demos/pc/app/notify/basic-usage.vue index 770985ae4c..e89b701d57 100644 --- a/examples/sites/demos/pc/app/notify/basic-usage.vue +++ b/examples/sites/demos/pc/app/notify/basic-usage.vue @@ -1,6 +1,7 @@通知消息的标题
, + title: '通知消息的标题', message: '通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文', position: 'top-right', duration: 5000, customClass: 'my-custom-cls' }) + }, + handleClickJxs() { + Notify({ + type: 'info', + title: () =>通知消息的标题
, + message: () => ( + 通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文 + ), + position: 'top-right', + duration: 5000, + customClass: 'my-custom-cls' + }) } } } diff --git a/examples/sites/demos/pc/app/notify/debounceDelay-composition-api.vue b/examples/sites/demos/pc/app/notify/debounceDelay-composition-api.vue index 58c37f2cbe..47487235db 100644 --- a/examples/sites/demos/pc/app/notify/debounceDelay-composition-api.vue +++ b/examples/sites/demos/pc/app/notify/debounceDelay-composition-api.vue @@ -11,7 +11,7 @@ import { Notify, Button as TinyButton } from '@opentiny/vue' const handleClick = ref( Notify({ type: 'info', - title: (h, params) =>通知消息的标题
, + title: '通知消息的标题', message: '通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文', position: 'top-right', duration: 1000, diff --git a/examples/sites/demos/pc/app/notify/debounceDelay.vue b/examples/sites/demos/pc/app/notify/debounceDelay.vue index 733d28484a..2148a39f1c 100644 --- a/examples/sites/demos/pc/app/notify/debounceDelay.vue +++ b/examples/sites/demos/pc/app/notify/debounceDelay.vue @@ -15,7 +15,7 @@ export default { return { handleClick: Notify({ type: 'info', - title: (h, params) =>通知消息的标题
, + title: '通知消息的标题', message: '通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文', position: 'top-right', duration: 1000, diff --git a/examples/sites/demos/pc/app/notify/duration-composition-api.vue b/examples/sites/demos/pc/app/notify/duration-composition-api.vue index ee4382594d..868b4f28ec 100644 --- a/examples/sites/demos/pc/app/notify/duration-composition-api.vue +++ b/examples/sites/demos/pc/app/notify/duration-composition-api.vue @@ -1,6 +1,5 @@+
+
+
+
通知消息的标题
, + title: '通知消息的标题', message: '通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文', showClose: false, - position: 'top-right', - duration: 500000 + position: 'top-right' }) } diff --git a/examples/sites/demos/pc/app/notify/showClose.vue b/examples/sites/demos/pc/app/notify/showClose.vue index e2fb476337..d11eb437cd 100644 --- a/examples/sites/demos/pc/app/notify/showClose.vue +++ b/examples/sites/demos/pc/app/notify/showClose.vue @@ -15,11 +15,10 @@ export default { baseClick() { Notify({ type: 'info', - title: (h, params) =>通知消息的标题
, + title: '通知消息的标题', message: '通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文', showClose: false, - position: 'top-right', - duration: 500000 + position: 'top-right' }) } } diff --git a/examples/sites/demos/pc/app/notify/showIcon-composition-api.vue b/examples/sites/demos/pc/app/notify/showIcon-composition-api.vue index 91fc775552..728b73f460 100644 --- a/examples/sites/demos/pc/app/notify/showIcon-composition-api.vue +++ b/examples/sites/demos/pc/app/notify/showIcon-composition-api.vue @@ -10,11 +10,10 @@ import { Notify, Button as TinyButton } from '@opentiny/vue' function baseClick() { Notify({ type: 'info', - title: (h, params) =>通知消息的标题
, + title: '通知消息的标题', message: '通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文', showIcon: false, - position: 'top-right', - duration: 500000 + position: 'top-right' }) } diff --git a/examples/sites/demos/pc/app/notify/showIcon.vue b/examples/sites/demos/pc/app/notify/showIcon.vue index bf76aa0bd8..e365750891 100644 --- a/examples/sites/demos/pc/app/notify/showIcon.vue +++ b/examples/sites/demos/pc/app/notify/showIcon.vue @@ -15,11 +15,10 @@ export default { baseClick() { Notify({ type: 'info', - title: (h, params) =>通知消息的标题
, + title: '通知消息的标题', message: '通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文', showIcon: false, - position: 'top-right', - duration: 500000 + position: 'top-right' }) } } diff --git a/examples/sites/demos/pc/app/notify/title-composition-api.vue b/examples/sites/demos/pc/app/notify/title-composition-api.vue deleted file mode 100644 index 7295f24bde..0000000000 --- a/examples/sites/demos/pc/app/notify/title-composition-api.vue +++ /dev/null @@ -1,18 +0,0 @@ - -通知消息的标题
, + title: '通知消息的标题', message: '通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文', position: 'top-right', - duration: 500000, customClass: 'my-custom-cls' }) } diff --git a/examples/sites/demos/pc/app/notify/type.vue b/examples/sites/demos/pc/app/notify/type.vue index 18c9ffbb7b..5f84ac4244 100644 --- a/examples/sites/demos/pc/app/notify/type.vue +++ b/examples/sites/demos/pc/app/notify/type.vue @@ -18,10 +18,9 @@ export default { infoClick() { Notify({ type: 'info', - title: (h, params) =>通知消息的标题
, + title: '通知消息的标题', message: '通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文', position: 'top-right', - duration: 500000, customClass: 'my-custom-cls' }) }, diff --git a/examples/sites/demos/pc/app/notify/verticalOffset-composition-api.vue b/examples/sites/demos/pc/app/notify/verticalOffset-composition-api.vue index fade46394a..d2a0a373f1 100644 --- a/examples/sites/demos/pc/app/notify/verticalOffset-composition-api.vue +++ b/examples/sites/demos/pc/app/notify/verticalOffset-composition-api.vue @@ -10,10 +10,9 @@ import { Notify, Button as TinyButton } from '@opentiny/vue' function handleClick() { Notify({ type: 'info', - title: (h, params) =>通知消息的标题
, + title: '通知消息的标题', message: '通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文', position: 'top-right', - duration: 500000, customClass: 'my-custom-cls', verticalOffset: 100 }) diff --git a/examples/sites/demos/pc/app/notify/verticalOffset.vue b/examples/sites/demos/pc/app/notify/verticalOffset.vue index 4ac63ad6a8..92388f3ea9 100644 --- a/examples/sites/demos/pc/app/notify/verticalOffset.vue +++ b/examples/sites/demos/pc/app/notify/verticalOffset.vue @@ -15,10 +15,9 @@ export default { handleClick() { Notify({ type: 'info', - title: (h, params) =>通知消息的标题
, + title: '通知消息的标题', message: '通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文', position: 'top-right', - duration: 500000, customClass: 'my-custom-cls', verticalOffset: 100 }) diff --git a/examples/sites/demos/pc/app/notify/webdoc/notify.js b/examples/sites/demos/pc/app/notify/webdoc/notify.js index 57992f9679..2767ee7c67 100644 --- a/examples/sites/demos/pc/app/notify/webdoc/notify.js +++ b/examples/sites/demos/pc/app/notify/webdoc/notify.js @@ -9,8 +9,24 @@ export default { 'en-US': 'Basic Usage' }, desc: { - 'zh-CN': '通过函数调用的方式使用组件。', - 'en-US': 'Components are used by means of function calls' + 'zh-CN': ` + 通过Notify
函数,在页面上弹出通知框组件。+ 通过
title
属性设置通知框标题。+ 通过
message
属性设置通知框的内容。+
小技巧
+ 标题和内容不仅支持字符串传入,还支持 jsx
和 h
函数的写法。
+ Notify
function is used to display the notification component on the page. + Set the title of the notification box with the
title
property. + Set the contents of the notification box with the
message
property. +
Tips
+ The title and content support not only string passing, but also the writing of jsx
and h
functions.
+ 可通过 duration
属性设置自动关闭的延迟时间,默认值:4500ms 。
duration
属性设置自动关闭的延迟时间, 默认情况, success info
延时5秒 warning error
延时10秒自动关闭。',
'en-US':
- 'You can set the delay for automatic shutdown through the duration
attribute. The default value is 4500 ms.
duration
property to set the automatic shutdown delay. By default, success info
delays the shutdown by 5 seconds. warning error
delays the shutdown by 10 seconds.'
},
codeFiles: ['duration.vue']
},
@@ -54,30 +71,6 @@ export default {
},
codeFiles: ['position.vue']
},
- {
- demoId: 'title',
- name: {
- 'zh-CN': '标题',
- 'en-US': 'Title'
- },
- desc: {
- 'zh-CN': '可通过 title
属性设置通知框标题。
You can set the title of the notification box through the title
attribute.
可通过 message
属性设置通知框的内容。
You can set the content of the notification box through the message
attribute.
-
-
-
-
-
-