2026-05-30 19:57:52 +08:00
|
|
|
import { createApp, Text, useAppContext } from "@vue-tui/runtime";
|
2026-05-26 22:27:05 +08:00
|
|
|
import { defineComponent, onMounted } from "vue";
|
|
|
|
|
|
|
|
|
|
const App = defineComponent(() => {
|
2026-05-30 19:57:52 +08:00
|
|
|
const { exit } = useAppContext();
|
2026-05-26 22:27:05 +08:00
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
const error = new Error("errored");
|
|
|
|
|
(error as Error & { value: string }).value = "hello from error";
|
|
|
|
|
exit(error);
|
|
|
|
|
}, 500);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return () => <Text>Testing</Text>;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const app = createApp(App);
|
|
|
|
|
app.mount();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
await app.waitUntilExit();
|
|
|
|
|
} catch (error: unknown) {
|
|
|
|
|
console.log((error as Error).message);
|
|
|
|
|
}
|