摘要: * find 遍历数组,找到第一个符合条件的项,并返回该项; 不会继续遍历数组;否则返回undefined; 不会改变数组; ``` [1,5,10,15].find(function(value,index,arr){ return value > 9 }) //10 ``` * findInde 阅读全文
posted @ 2023-06-26 15:24 大BUG 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 对于路由多的vue项目,编译时时间会很长 1.安装webpack插件hard-source-webpack-plugin,对模块编译进行缓存 npm install hard-source-webpack-plugin --save-dev 第一次构建时是进行缓存,第二次编译会感觉速度会有很大提升 阅读全文
posted @ 2023-03-08 17:43 大BUG 阅读(556) 评论(0) 推荐(0) 编辑
摘要: 在模板文件中引入 <component :is="handleComponent" /> 在js中使用 const handleView = (viewUrl) => import('../' + viewUrl) //引入文件路径 export default { data(){ return { 阅读全文
posted @ 2023-03-06 15:29 大BUG 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 安装插件vue-pdf npm install vue-pdf --save 在vue中使用 import pdf from 'vue-pdf' data() { return { src: '', numPages: undefined, loadNum: 0 } }, const loading 阅读全文
posted @ 2023-03-06 15:17 大BUG 阅读(781) 评论(0) 推荐(0) 编辑
摘要: app.js中引入koa npm install koa 安装koa-bodyparser,解析post数据 npm install koa-bodyparser 安装数据库链接sequelize npm install sequelize 安装koa路由koa-router npm install 阅读全文
posted @ 2023-03-06 15:03 大BUG 阅读(58) 评论(0) 推荐(0) 编辑
摘要: // 获取当前时间 /** * 获取当前时间 */ export function getNowTime(str) { const yy = new Date().getFullYear() const MM = (new Date().getMonth() + 1) < 10 ? '0' + (n 阅读全文
posted @ 2022-03-26 10:14 大BUG 阅读(451) 评论(0) 推荐(0) 编辑
摘要: 返回过多 用wx.redirectTo或者wx.reLaunch 解决 阅读全文
posted @ 2021-07-19 14:10 大BUG 阅读(880) 评论(0) 推荐(0) 编辑
摘要: 公司的一个小程序,要做一个活动,需要判断登录状态。 思路:h5跳转到登录页面,登陆成功携带token自动返回。 本来以为是个非常简单的功能,没想到..... 发帖记录一下 1、登录页面 用getCurrentPages()方法给上一个页面传参 获取上一个页面 将webview页面的path路径置为空 阅读全文
posted @ 2020-11-17 15:01 大BUG 阅读(2081) 评论(0) 推荐(0) 编辑
摘要: 1、h5跳转到小程序 首先引入js文件 <script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script> 跳转方法 ①跳转到小程序内页 wx.miniProgram.navigateTo({ url: '/pages/con 阅读全文
posted @ 2020-11-17 14:29 大BUG 阅读(5847) 评论(0) 推荐(0) 编辑
摘要: wxml <view style="height:{{titleHeight}}px;background:{{background}}" class="user-main-top" id="user-main-top"> <view class="user-main-top-text" style 阅读全文
posted @ 2020-11-16 16:46 大BUG 阅读(312) 评论(0) 推荐(0) 编辑