54b5394e88
- issue-450-fixture-helpers.tsx with rerender/initial helpers - 5 issue-450 fixture files (fullscreen, overflow, grow, shrink) - 2 useAnimation exit fixtures (interactive false, non-interactive) - 7 tests with exact clearTerminal/eraseLine count assertions Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
22 lines
469 B
TypeScript
22 lines
469 B
TypeScript
import { Text, createApp, useAnimation, useExit } from "@vue-tui/runtime";
|
|
import { defineComponent, watch } from "vue";
|
|
|
|
const Spinner = defineComponent(() => {
|
|
const { frame } = useAnimation({ interval: 8 });
|
|
const exit = useExit();
|
|
|
|
watch(frame, (value) => {
|
|
if (value >= 3) {
|
|
exit();
|
|
}
|
|
});
|
|
|
|
return () => <Text>{String(frame.value)}</Text>;
|
|
});
|
|
|
|
const app = createApp(Spinner);
|
|
app.mount();
|
|
|
|
await app.waitUntilExit();
|
|
console.log("exited");
|