diff --git a/src/scroll/index.wc b/src/scroll/index.wc index 1c3a69c..649aeb1 100644 --- a/src/scroll/index.wc +++ b/src/scroll/index.wc @@ -282,9 +282,17 @@ export default class Scroll { bind(document, 'mousemove', mousemoveFn) bind(document, 'mouseup', mouseupFn) }) + + this.__observer = new MutationObserver(this._initFn) + this.__observer.observe(this, { + childList: true, + subtree: true, + characterData: true + }) } unmount() { + this.__observer.disconnect() unbind(this.__BOX__, 'mouseenter', this._initFn) unbind(this.__BOX__, 'wheel', this._wheelFn) }