提交 bbd42de6 编写于 作者: 雪洛's avatar 雪洛

fix(uni-app-x web): setPageStyle设置enablePullDownRefresh为false后再设置为true无效的Bug

上级 f3bc473a
import { type Ref, onMounted } from 'vue'
import { type Ref, nextTick, onMounted, watch } from 'vue'
import { invokeHook } from '@dcloudio/uni-core'
import {
API_START_PULL_DOWN_REFRESH,
......@@ -71,7 +71,7 @@ export function usePageRefresh(refreshRef: Ref) {
false,
id
)
onMounted(() => {
function initElement() {
refreshContainerElem = refreshRef.value.$el
refreshControllerElem =
refreshContainerElem.querySelector('.uni-page-refresh')!
......@@ -81,7 +81,23 @@ export function usePageRefresh(refreshRef: Ref) {
'.uni-page-refresh-inner'
) as HTMLDivElement
).style
}
onMounted(() => {
initElement()
})
if (__X__) {
watch(
() => pageMeta.enablePullDownRefresh,
(enablePullDownRefresh) => {
if (enablePullDownRefresh) {
nextTick(() => {
initElement()
})
}
}
)
}
let touchId: number | null
let startY: number
let canRefresh: boolean
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册