diff --git a/src/platforms/h5/components/app/popup/mixins/toast.js b/src/platforms/h5/components/app/popup/mixins/toast.js index 3dd0be026fd88eb0aa3878738f0b6a5d61088d7b..44a3f0ef2e02991212eb99096c415a07d946a956 100644 --- a/src/platforms/h5/components/app/popup/mixins/toast.js +++ b/src/platforms/h5/components/app/popup/mixins/toast.js @@ -7,7 +7,7 @@ export default { } }, created () { - let showType = '' + let showType = '' const createOnShow = (type) => { return (args) => { @@ -23,6 +23,9 @@ export default { const createOnHide = (type) => { return () => { + if (!showType) { + return + } let warnMsg = '' if (type === 'onHideToast' && showType !== 'onShowToast') { warnMsg = '请注意 showToast 与 hideToast 必须配对使用' @@ -31,7 +34,7 @@ export default { } if (warnMsg) { return console.warn(warnMsg) - } + } showType = '' setTimeout(() => { // 与 show 对应延迟10ms,避免快速调用 show,hide 导致无法关闭 this.showToast.visible = false