1. 检查语法是否有问题 (https://f2.antv.vision/en/docs/api/chart/scroll-bar)
const F2 = require('@antv/f2/lib/index');
const ScrollBar = require('@antv/f2/lib/plugin/scroll-bar');
F2.Chart.plugins.register(ScrollBar);
const chart = new F2.Chart({
id: 'canvas',
plugins: ScrollBar
});
chart.scrollBar({
});
2. 引入的 js 是否有问题, 要引入f2-all.min.js (可以换下面的地址试试)
<script src="https://gw.alipayobjects.com/os/lib/antv/f2/3.8.9/dist/f2-all.min.js"></script>
import F2 from 'https://gw.alipayobjects.com/os/lib/antv/f2/3.8.9/dist/f2-all.min.js'