1.新建commonjs文件夹,在里面新建index.js 2.commonjs/index.js,公共方法如下: 3.main.js中引入 4.页面中调用 转载于:https://www.cnblogs.com/dyy-dida/p/11458934.html