3995e84285
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>
21 lines
472 B
TypeScript
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");
|