mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(Sticky): broke ssr (#5958)
This commit is contained in:
parent
4dc3c79090
commit
336295ebaa
@ -1,5 +1,5 @@
|
|||||||
import { isHidden } from '../utils/dom/style';
|
import { isHidden } from '../utils/dom/style';
|
||||||
import { createNamespace, isDef } from '../utils';
|
import { createNamespace, isDef, isServer } from '../utils';
|
||||||
import { getScrollTop, getElementTop, getScroller } from '../utils/dom/scroll';
|
import { getScrollTop, getElementTop, getScroller } from '../utils/dom/scroll';
|
||||||
import { BindEventMixin } from '../mixins/bind-event';
|
import { BindEventMixin } from '../mixins/bind-event';
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ export default createComponent({
|
|||||||
|
|
||||||
created() {
|
created() {
|
||||||
// compatibility: https://caniuse.com/#feat=intersectionobserver
|
// compatibility: https://caniuse.com/#feat=intersectionobserver
|
||||||
if (window.IntersectionObserver) {
|
if (!isServer && window.IntersectionObserver) {
|
||||||
this.observer = new IntersectionObserver(
|
this.observer = new IntersectionObserver(
|
||||||
entries => {
|
entries => {
|
||||||
// trigger scroll when visibility changed
|
// trigger scroll when visibility changed
|
||||||
|
Loading…
x
Reference in New Issue
Block a user