uni-app vue3 setup not support app event onError

1szpjjfi  于 4个月前  发布在  uni-app
关注(0)|答案(1)|浏览(123)

不工作

<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>
23c0lvtd

23c0lvtd1#

试试在 setup 里使用 vue3 原生的 onErrorCaptured 生命周期

相关问题