会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
1940
博客园
首页
新随笔
联系
订阅
管理
2025年3月26日
uniapp 文本框增加删除图标
摘要: 代码块存档 //扫描框 <view class="scanCodeBox"> <input class="inputContent" type="number" @blur="loseFocus" :disabled="false" :value="textValue" placeholder="请
阅读全文
posted @ 2025-03-26 10:08 格林格林
阅读(84)
评论(0)
推荐(0)
2025年3月12日
vue3uniapp子组件触发父组件function uni.$emit() uni.$on()
摘要: 父组件 uni.$on('update', function (data) { console.log('监听到事件来自 update ,携带参数 msg 为:' + data.msg); getListdata(resData.value); }) 子组件 function click(){ un
阅读全文
posted @ 2025-03-12 09:30 格林格林
阅读(72)
评论(0)
推荐(0)
2025年3月6日
vue3 vuex 同步数据
摘要: import { useStore } from 'vuex'; let store = useStore(); const item = computed(() => { return { name: store.state.printerName, deviceId: store.state.d
阅读全文
posted @ 2025-03-06 15:35 格林格林
阅读(23)
评论(0)
推荐(0)
uniapp app 等待弹窗
摘要: let wait = ref() function wait(){ //打开等待弹窗 wait.value = plus.nativeUI.showWaiting("正在连接蓝牙..."); // 2秒后更新等待对话框上显示的文字内容 setTimeout(function(){ w.setTitl
阅读全文
posted @ 2025-03-06 11:13 格林格林
阅读(38)
评论(0)
推荐(0)
2025年2月28日
uniapp app端弹窗提示 代码块
摘要: 前提:uniapp的app端,用uni自带的toast,icon会自占一行,很丑 如图: 利用 plus.nativeUI.toast 显示正常大小的icon plus.nativeUI.toast( e,//提示文字 { type: 'text', duration: 'short', iconW
阅读全文
posted @ 2025-02-28 10:29 格林格林
阅读(90)
评论(0)
推荐(0)
2025年2月27日
利用plus.camera.getCamera()实现PDA中的uniapp拍照,并返回文件路径
摘要: 前提: uni自带的拍照插件不支持app使用 需要实现PDA拍照,并识别拍照内容,显示到文本框 uniapp的app端用不了tesseract.js ,因为nodejs没有blob,放弃前端识别文本 plus.camera.getCamera( index ); 指定要获取摄像头的索引值,1表示主摄
阅读全文
posted @ 2025-02-27 17:07 格林格林
阅读(464)
评论(0)
推荐(0)
2025年2月18日
格式化UTC时间
摘要: 格式化时间方法 function formatDate(time, format) { var t = new Date(time); var tf = function (i) { return (i < 10 ? '0' : '') + i }; return format.replace(/y
阅读全文
posted @ 2025-02-18 14:23 格林格林
阅读(21)
评论(0)
推荐(0)
2025年2月14日
uniapp+vue3 实现PDA扫码功能
摘要: 需求:按PDA的扫码键,把扫码内容填入input中 scanner.js 扫描工具类 let main; let filter; let receiver; let tag = false; /** * 开始广播监听扫码 */ const start = () => { /* #ifdef APP-
阅读全文
posted @ 2025-02-14 15:39 格林格林
阅读(397)
评论(0)
推荐(0)
2025年2月13日
uniapp+vue3 页面下拉刷新onPullDownRefresh
摘要: //index.vue import {onPullDownRefresh} from "@dcloudio/uni-app" //下拉刷新页面 onPullDownRefresh(() => { setTimeout(function () { console.log('start pulldow
阅读全文
posted @ 2025-02-13 11:46 格林格林
阅读(444)
评论(0)
推荐(0)
2025年2月12日
对象数组去重
摘要: arr是需要去重的数组 let arr = [{a:1,b:2},{a:1,b:2},{a:2,b:3}] result是去重后的数组 const strings = arr.map((item) => JSON.stringify(item)) const removeDupList = Arra
阅读全文
posted @ 2025-02-12 15:32 格林格林
阅读(9)
评论(0)
推荐(0)
下一页
公告