mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(BackTop): failed to get element ref (#11269)
This commit is contained in:
parent
5cf4322143
commit
5bbdb0f40c
@ -95,11 +95,10 @@ export default defineComponent({
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
if (inBrowser) {
|
||||
scrollParent.value = document.documentElement;
|
||||
target = props.target
|
||||
? (getTarget() as typeof target)
|
||||
: (getScrollParent(backTopEl.value!) as typeof target);
|
||||
scrollParent.value = target as typeof target;
|
||||
scrollParent.value = target;
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -107,7 +106,7 @@ export default defineComponent({
|
||||
return () => {
|
||||
const Content = (
|
||||
<div
|
||||
ref="backTopEl"
|
||||
ref={backTopEl}
|
||||
class={bem({ active: show.value })}
|
||||
style={backTopStyle.value}
|
||||
onClick={onClick}
|
||||
|
Loading…
x
Reference in New Issue
Block a user