This commit is contained in:
陆柯 2022-02-18 13:43:56 +08:00
parent 173e28618d
commit abd64f9b2b

View File

@ -403,7 +403,7 @@ export default {
showToast({ tool, type, image, title, duration = 2000, ...rest }) { showToast({ tool, type, image, title, duration = 2000, ...rest }) {
const pageNow = this?.$store ? this // 对于组件内定义的 i18nText要使用 this 来获得组建内的 i18nText而不是 getCurrentPages[...] 去访问全局页面的 i18nText。 const pageNow = this?.$store ? this // 对于组件内定义的 i18nText要使用 this 来获得组建内的 i18nText而不是 getCurrentPages[...] 去访问全局页面的 i18nText。
: getCurrentPages()[getCurrentPages().length - 1] : getCurrentPages()[getCurrentPages().length - 1]
if (tool === 'uni' || !(pageNow.$refs && pageNow.$refs.toast)) { if (tool === 'uni' || ! pageNow?.$refs?.toast) {
// #ifdef APP-PLUS // #ifdef APP-PLUS
uni.showToast({ icon: 'none', title, duration, ...rest }) uni.showToast({ icon: 'none', title, duration, ...rest })
// #endif // #endif