提交 1ad2af71 编写于 作者: D DCloud_LXH

fix(app-plus): script setup onPageScroll、onReachBottom not effective question/162503

上级 54686c68
......@@ -81,6 +81,21 @@ export function lifecycleMixin (Vue) {
})
}
// script setup onPageScroll、onReachBottom not effective
const setup = extendOptions.setup
if (setup) {
const injectHooks = ['onPageScroll', 'onReachBottom']
let setupString = ''
try {
setupString = setup.toString()
} catch (error) {}
injectHooks.forEach(hook => {
if (setupString.indexOf(`uniApp.${hook}`) && !extendOptions[hook]) {
extendOptions[hook] = [() => {}]
}
})
}
return oldExtend.call(this, extendOptions)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册