Files
vue-tui/packages/runtime-tests/integration/pty/fixtures/console.tsx
T
Yunfei He 3995e84285 test: add PTY console and useStdout fixture scripts + tests
Port console.log and useStdout.write fixtures from Ink to verify
patchConsole and useStdout().write() work correctly in a real terminal.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 22:45:17 +08:00

21 lines
472 B
TypeScript

import { createApp, Text } from "@vue-tui/runtime";
import { defineComponent, h, onMounted, onScopeDispose } from "vue";
const App = defineComponent(() => {
onMounted(() => {
const timer = setTimeout(() => {}, 1000);
onScopeDispose(() => {
clearTimeout(timer);
});
});
return () => h(Text, null, { default: () => "Hello World" });
});
const app = createApp(App);
app.mount();
console.log("First log");
app.unmount();
console.log("Second log");