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(() => {
|
onMounted(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
if (inBrowser) {
|
if (inBrowser) {
|
||||||
scrollParent.value = document.documentElement;
|
|
||||||
target = props.target
|
target = props.target
|
||||||
? (getTarget() as typeof target)
|
? (getTarget() as typeof target)
|
||||||
: (getScrollParent(backTopEl.value!) 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 () => {
|
return () => {
|
||||||
const Content = (
|
const Content = (
|
||||||
<div
|
<div
|
||||||
ref="backTopEl"
|
ref={backTopEl}
|
||||||
class={bem({ active: show.value })}
|
class={bem({ active: show.value })}
|
||||||
style={backTopStyle.value}
|
style={backTopStyle.value}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user