摘要: 解决方法 更换国内代理镜像 添加环境变量(用户变量或系统变量都可以) PUB_HOSTED_URL = https://mirrors.tuna.tsinghua.edu.cn/dart-pub FLUTTER_STORAGE_BASE_URL = https://mirrors.tuna.tsin 阅读全文
posted @ 2023-02-22 15:58 bugSource 阅读(531) 评论(0) 推荐(0) 编辑
摘要: 场景应用 微信小程序使用wx.previewImage()浏览图片,但是后台传过来的是base64数据。 思路 先把base64作为临时文件存到本地,然后预览,预览结束时删除临时文件 // 获取应用实例 const app = getApp() Page({ data: { //base64数据,由 阅读全文
posted @ 2023-01-18 17:56 bugSource 阅读(513) 评论(0) 推荐(0) 编辑
摘要: 场景应用 微信小程序使用TCP通讯,接收数据的类型为ArrayBuffer,转字符串后中文乱码。(uniapp开发) // 原本使用方法 // 拿到TCP通讯的 ArrayBuffer 数据 let unit8Arr = new Uint8Array(arrayBuffer) let encoded 阅读全文
posted @ 2022-12-14 11:40 bugSource 阅读(4924) 评论(0) 推荐(0) 编辑
摘要: el-input 回车触发事件并且重新聚焦全选文本 <el-input style="width:140px;" v-model="value" @keyup.enter.native="enterInput" @focus="getInputFocus($event)" ref="toFoucus 阅读全文
posted @ 2021-12-10 10:34 bugSource 阅读(504) 评论(0) 推荐(0) 编辑
摘要: 覆盖数组对象 业务场景:对象A与对象B具有相同属性的情况下,把对象B的属性值赋值到对象A中,且不影响对象A的其他属性。(数组对象中如果嵌套了其他数组对象,则该方法不适用) var o1 = [ { name: '小明', age: 18, sex: '男' }, { name: '小红', age: 阅读全文
posted @ 2021-08-03 17:14 bugSource 阅读(1520) 评论(0) 推荐(0) 编辑
摘要: 记录异步处理的两种方式 例子说明:执行方法A之后再执行方法B 定义方法 // 方法A getStrA() { return new Promise((resolve, reject) => { resolve('方法A') }) }, // 方法B getStrB() { return new Pr 阅读全文
posted @ 2021-07-20 16:37 bugSource 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 记录eslintrc提示属性未定义的处理方式 例如提示: http://eslint.org/docs/rules/no-undef '__static' is not defined 处理: .eslintrc.js 添加代码 "globals": { "__static": true }, 阅读全文
posted @ 2021-07-15 11:19 bugSource 阅读(309) 评论(0) 推荐(0) 编辑
摘要: 场景应用 微信小程序的蓝牙设备通讯 正常写法 let len = 5 // 定义ArrayBuffer长度 let buffer = new ArrayBuffer(len) let dataView = new DataView(buffer) // 创建视图 dataView.setUint8( 阅读全文
posted @ 2021-05-26 10:31 bugSource 阅读(7479) 评论(0) 推荐(1) 编辑
摘要: 前言 项目需要将树莓派使用蓝牙作为从机被手机连接。 问题 树莓派开启蓝牙默认是不可见的,即手机搜索不到,这时候需要点击右上角的蓝牙图标 > Make Discoverable 将其设置为可见。 但是,如果长时间没有设备连接树莓派的话,它会自动关闭,而我需要的是它总是可见,让用户随时可以搜的出来。 解 阅读全文
posted @ 2021-05-21 14:17 bugSource 阅读(681) 评论(0) 推荐(0) 编辑
摘要: 1.跨域问题 找到src/main/index.js文件,或全局搜索BrowserWindow,添加代码取消跨域 mainWindow = new BrowserWindow({ height: 563, useContentSize: true, width: 1000, webPreferenc 阅读全文
posted @ 2021-04-30 17:01 bugSource 阅读(525) 评论(0) 推荐(0) 编辑