这是一个自定义滚动条模板 可以传参设置自定义颜色 HTML代码为 <body style="height:3000px"> <div class="scorll"></div> </body> //ES6模块化 <script type="module"> import { scorll } from './scorll.js'; scorll('color'); </script> js代码为 //自定义颜色 function(color){ xxxxx }