1. @better-scroll/observe-dom
Dynamic recalculating container's size for BetterScroll
@better-scroll/observe-dom
Package: @better-scroll/observe-dom
Created by: ustbhuangyi
Last modified: Fri, 19 May 2023 10:27:08 GMT
Version: 2.5.1
License: MIT
Downloads: 12,494
Repository: https://github.com/ustbhuangyi/better-scroll

Install

npm install @better-scroll/observe-dom
yarn add @better-scroll/observe-dom

@better-scroll/observe-dom

中文文档

recaculating BetterScroll's scrollHeight or scrollWidth by MutationObserver, with this, you don't care when BetterScroll's scrollHeight or scrollWidth have changed. Plugin has done it for you.

if current browser does not surpport MutationObserver, it will fallback to setTimeout in recursion

Usage

 import BScroll from '@better-scroll/core'
import ObserveDom from '@better-scroll/observe-dom'
BScroll.use(ObserveDom)

const bs = new BScroll('.wrapper', {
  observeDOM: true
})

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin