mirror of
https://github.com/youzan/vant.git
synced 2025-10-18 09:24:25 +00:00
fix(Sticky): broke ssr (#5958)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
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 { BindEventMixin } from '../mixins/bind-event';
|
||||
|
||||
@@ -65,7 +65,7 @@ export default createComponent({
|
||||
|
||||
created() {
|
||||
// compatibility: https://caniuse.com/#feat=intersectionobserver
|
||||
if (window.IntersectionObserver) {
|
||||
if (!isServer && window.IntersectionObserver) {
|
||||
this.observer = new IntersectionObserver(
|
||||
entries => {
|
||||
// trigger scroll when visibility changed
|
||||
|
Reference in New Issue
Block a user