Skip to content

Commit e0e8fa4

Browse files
fix: defineModel TS examples
1 parent 6fcf44c commit e0e8fa4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/api/sfc-script-setup.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,14 +347,15 @@ Like `defineProps` and `defineEmits`, `defineModel` can also receive type argume
347347

348348
```ts
349349
const modelValue = defineModel<string>()
350-
// ^? Ref<string | undefined>
350+
// type: Ref<string | undefined>
351351

352352
// default model with options, required removes possible undefined values
353353
const modelValue = defineModel<string>({ required: true })
354-
// ^? Ref<string>
354+
// type: Ref<string>
355355

356356
const [modelValue, modifiers] = defineModel<string, 'trim' | 'uppercase'>()
357-
// ^? Record<'trim' | 'uppercase', true | undefined>
357+
// modelValue: Ref<string | undefined>
358+
// modifiers: Record<'trim' | 'uppercase', true | undefined>
358359
```
359360

360361
## defineExpose() {#defineexpose}

0 commit comments

Comments
 (0)