不工作
<script setup lang="ts">
import {onError, onLaunch} from "@dcloudio/uni-app";
onLaunch(() => {
console.log('App Launch')
})
onError(() => {
console.log('Arrr')
})
</script>
can work
<script>
export default {
onLaunch: function () {
console.log('App Launch')
},
onError: function () {
console.log('App erre')
},
}
</script>
1条答案
按热度按时间23c0lvtd1#
试试在 setup 里使用 vue3 原生的 onErrorCaptured 生命周期