uni-code-scaner
v1.0.1
Published
>maina.js ``` import codeScaner from "uni-code-scaner" Vue.use(codeScaner) ``` >app.vue ``` this.$startListenScan() ``` >组件内使用,需要注意卸载和隐藏是把监听注销 ``` onShow() { uni.$on('codeScan', (code) => { this.getCode(code) }) }, onUnload() { console
Downloads
3
Readme
uni-code-scaner demo
maina.js
import codeScaner from "uni-code-scaner"
Vue.use(codeScaner)
app.vue
this.$startListenScan()
组件内使用,需要注意卸载和隐藏是把监听注销
onShow() {
uni.$on('codeScan', (code) => {
this.getCode(code)
})
},
onUnload() {
console.log("testonUnload")
uni.$off('codeScan')
},
onHide() {
console.log("testonHide")
uni.$off('codeScan')
},