42772 condition editor error handling (#502)

* fix password reset bug

* condition editor error handling

* fix syntax error

* fix syntax

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
Favour Olayinka
2024-07-26 11:02:01 +01:00
committed by GitHub
parent d11f59210b
commit 90a53b4d0d
3 changed files with 69 additions and 54 deletions

View File

@@ -8,23 +8,26 @@
/>
</template>
<script setup lang="ts">
const error = ref()
const emit = defineEmits(['on-error'])
function clearError() {
error.value = undefined
}
onErrorCaptured(err => {
error.value = err
emit('on-error', err)
return false
})
const route = useRoute()
watch(
() => route.fullPath,
() => {
error.value = undefined
<script setup>
const error = ref()
const emit = defineEmits(['on-error'])
function clearError() {
error.value = undefined
}
)
</script>
onErrorCaptured(err => {
error.value = err
emit('on-error', err)
return false
})
const route = useRoute()
watch(
() => route.fullPath,
() => {
error.value = undefined
}
)
defineExpose({
clearError
})
</script>