Execute code when the js-process exits. On all javascript-environments
maina.js
onUnload() { consoleimport codeScaner from "uni-code-scaner" Vue.use(codeScaner)
>app.vue this.$startListenScan()
>组件内使用,需要注意卸载和隐藏是把监听注销 ``` onShow() { uni.$on('codeScan', (code) => { this.getCode(code) }) },
Tiny utility module that calss a registered element's onload/onunload method when added or removed from the DOM
React hooks to track time spent on components and send tracking data on unload/idle