From 70acffa8075bdf9d9ee8e3a8ea5657f8027f0d25 Mon Sep 17 00:00:00 2001 From: Kui Chen Date: Mon, 3 Jun 2024 16:11:10 +0800 Subject: [PATCH 1/3] =?UTF-8?q?toast=E6=96=B0=E5=A2=9Etyep=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/component/toast.md | 2 ++ src/toast/toast.html | 10 +++++++++- src/toast/toast.js | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/component/toast.md b/docs/component/toast.md index 612f557..e9f44a5 100644 --- a/docs/component/toast.md +++ b/docs/component/toast.md @@ -10,6 +10,7 @@ toast 一般用于操作成功时的提示场景 | content | string | | toast的文字 | | options | Object | function | | 配置项或回调 | | [options.duration] | number | 3000 | 多少毫秒后关闭toast | +| [options.type] | 'success' | 'warning' | 'error'| 'none' | 'success' | 显示的图标 | | [options.callback] | function | | 关闭后的回调 | | [options.className] | string | | 自定义类名 | @@ -18,6 +19,7 @@ toast 一般用于操作成功时的提示场景 weui.toast('操作成功', 3000); weui.toast('操作成功', { duration: 3000, + type: 'none' className: 'custom-classname', callback: function(){ console.log('close') } }); diff --git a/src/toast/toast.html b/src/toast/toast.html index 3319d93..431cc86 100644 --- a/src/toast/toast.html +++ b/src/toast/toast.html @@ -1,7 +1,15 @@ diff --git a/src/toast/toast.js b/src/toast/toast.js index 200a2aa..8d5c3fa 100644 --- a/src/toast/toast.js +++ b/src/toast/toast.js @@ -32,6 +32,7 @@ let _sington; * weui.toast('操作成功', 3000); * weui.toast('操作成功', { * duration: 3000, + * type: 'success' | 'warning' | 'error'| 'none' * className: 'custom-classname', * extClass: 'toast-classname', * callback: function(){ console.log('close') } @@ -54,6 +55,7 @@ function toast(content = '', options = {}) { options = $.extend({ content: content, duration: 3000, + type: 'success', callback: $.noop, className: '', extClass: '' From ebb94f214b98707c95f7f1687f699a8e3711618d Mon Sep 17 00:00:00 2001 From: Kui Chen Date: Mon, 3 Jun 2024 16:18:51 +0800 Subject: [PATCH 2/3] ignore --- .DS_Store | Bin 6148 -> 6148 bytes .gitignore | 1 + 2 files changed, 1 insertion(+) diff --git a/.DS_Store b/.DS_Store index af692fade7af44202164b7f8c6460d49362514cc..3cf60cd9e119feaab8a69945eff67837de2052fa 100644 GIT binary patch literal 6148 zcmeHK%}T>S5T4akw-vDmL65n3^H6^fJP4uc!J81#gGx1Tdj3>bEh?0cZa*1@VB>iMx(l1 zS=-nibf6MUQo+lmXKZ za$!pAvt?NZECau1fWHqel+iO-YE+*N7&QU_9fXy@=UIYtT!Ws$QX^I%LZP49x1sCg1;uKhOW;N%qMy zU>TSy2846qAGA@DxmzcS{UO`!SU#U^0z?kb;IeZnbLX}|6We4aPEHxqmv3~>< L4c1r&{*-|a30j#B delta 76 zcmZoMXfc=|#>CJzu~2NHo+2aT!~knX#>qS^s+(2W9x-lK;9zIj*pSP(nVo~51E_4X eAjfy+$^0U^oQw<%3#A diff --git a/.gitignore b/.gitignore index 28d8b43..213ef25 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ node_modules/ *.log /docs/_book/ uploader-server/uploads +.DS_Store From c48d282078a7b6fe55686c90f0ce3c269b53f537 Mon Sep 17 00:00:00 2001 From: Kui Chen Date: Mon, 3 Jun 2024 16:24:58 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/component/toast.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/component/toast.md b/docs/component/toast.md index e9f44a5..06b06e6 100644 --- a/docs/component/toast.md +++ b/docs/component/toast.md @@ -10,9 +10,10 @@ toast 一般用于操作成功时的提示场景 | content | string | | toast的文字 | | options | Object | function | | 配置项或回调 | | [options.duration] | number | 3000 | 多少毫秒后关闭toast | -| [options.type] | 'success' | 'warning' | 'error'| 'none' | 'success' | 显示的图标 | +| [options.type] | 'success' | 'warning' | 'error' | 'none' | 'success' | 显示的图标 | | [options.callback] | function | | 关闭后的回调 | -| [options.className] | string | | 自定义类名 | +| [options.className] | string | | 自定义根节点类名 | +| [options.extClass] | string | | 自定义内容节点类名 | **Example** ```js @@ -20,7 +21,8 @@ weui.toast('操作成功', 3000); weui.toast('操作成功', { duration: 3000, type: 'none' - className: 'custom-classname', + className: 'root', + extClass: 'content', callback: function(){ console.log('close') } }); ```