Installation
NPM
better-scroll is hosted at Npm, you can install it by the following command:
npm install better-scroll --save
Next you can import better-scroll to your code. Building tools like webpack all support importing code from node_modules:
import BScroll from 'better-scroll'
If you use the syntax of ES5, the code is as following:
var BScroll = require('better-scroll')
script load
better-scroll also supports the way of loading script directly. There will be a BScroll object in window when loaded.
You can use the following address: https://unpkg.com/better-scroll/dist/bscroll.min.js
. Alternative is copying the files in the directory of dist and publishing them in your own cdn servers.