提交 ddb4c603 编写于 作者: fxy060608's avatar fxy060608

fix(h5): Remove the warning message when hideToast is called after the $route changes #1430

上级 e714397a
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册