fix(coding-agent): lazy-init OpenAI client to avoid top-level throw

This commit is contained in:
Yunfei He
2026-05-24 22:33:58 +08:00
parent 253fa8bfc6
commit 9f9edcf991
2 changed files with 17 additions and 18 deletions
+6 -13
View File
@@ -26,22 +26,15 @@ createApp(App).mount();
```vue
<!-- src/App.vue -->
<script lang="ts">
import { shallowRef, defineComponent } from "vue";
<script setup lang="ts">
import { shallowRef } from "vue";
import { Box, Text, useInput } from "@vue-tui/runtime";
export default defineComponent({
components: { Box, Text },
setup() {
const count = shallowRef(0);
const count = shallowRef(0);
useInput((input) => {
if (input === "+") count.value++;
if (input === "-") count.value--;
});
return { count };
},
useInput((input) => {
if (input === "+") count.value++;
if (input === "-") count.value--;
});
</script>