更新记录
1.0.0(2022-07-27) 下载此版本
-
平台兼容性
uni-app
Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
---|---|---|---|---|---|---|---|---|
√ | - | - | - | - | - | - | - | - |
微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
---|---|---|---|---|---|---|---|---|---|---|
- | - | - | - | - | - | - | - | - | - | - |
barcode 自定义扫码
使用说明
components
目录下的文件是自定义扫码组件
,使用方法只需通过v-model
给该组件进行传值即可<liusheng22-barcode ref="barcode" v-model="visible" @success="success" @fail="fail" />
ref
用于调用自定义扫码组件内部的方法v-model
用于控制自定义扫码组件的显示/隐藏@success
扫码成功后的回调@fail
扫码失败后的回调
page
目录下的文件是自定义扫码页面
,使用方法将其页面定义到pages.json
中,然后通过uni.navigateTo
进行跳转即可{ "path": "pages/barcode/barcode", "style": { "navigationStyle": "custom", "navigationBarTextStyle": "white" } }
- 该页面扫码成功后,会使用
uni.$emit
进行事件通知,请自行通过uni.$on
进行接收通知uni.$emit('barcodeComplete')
温馨提示
tips
- 如果使用
页面
级别的自定义扫码,请使用pages
目录下的文件 - 如果使用
组件
级别的自定义扫码,请使用components
目录下的文件