PHP笔记-laravel中使用jquery及jquery.niceScroll.js

x33g5p2x  于2022-06-10 转载在 JavaScript  
字(0.6k)|赞(0)|评价(0)|浏览(329)

首先用npm安装好jquery和jquery.niceScroll

npm install jquery
npm install jquery.nicescroll

安装好后在node_modules中可以看到:

在webpack.mix.js中添加:

如下:

mix.copy('node_modules/jquery/dist/jquery.js', 'public/vendor/jquery/jquery.js');
mix.copy('node_modules/jquery.nicescroll/dist/jquery.nicescroll.js', 'public/vendor/jquery/jquery.niceScroll.js');

在对应的xx.blame.html文件中进行script

<script src="{{ asset('vendor/jquery/jquery.js') }}"></script>
    <script src="{{ asset('vendor/jquery/jquery.niceScroll.js') }}"></script>

这样就可以获取到了。chrome浏览器测如下;

开发者涨薪指南

48位大咖的思考法则、工作方式、逻辑体系

相关文章