]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore(dx): fix defineProps jsdoc + update defineEmits jsdoc example
authorEvan You <yyx990803@gmail.com>
Thu, 7 Dec 2023 06:30:32 +0000 (14:30 +0800)
committerEvan You <yyx990803@gmail.com>
Thu, 7 Dec 2023 06:30:32 +0000 (14:30 +0800)
packages/runtime-core/src/apiSetupHelpers.ts

index 509c280d63b5d8a05b17bb9b4e6c1067c5a50034..de4f93e00606ff091b79c4e9265b104e4b32a113 100644 (file)
@@ -66,9 +66,9 @@ const warnRuntimeUsage = (method: string) =>
  *   foo?: string
  *   bar: number
  * }>()
+ * ```
  *
  * @see {@link https://vuejs.org/api/sfc-script-setup.html#defineprops-defineemits}
- * ```
  *
  * This is only usable inside `<script setup>`, is compiled away in the
  * output and should **not** be actually called at runtime.
@@ -116,8 +116,9 @@ type BooleanKey<T, K extends keyof T = keyof T> = K extends any
  * Example type-based declaration:
  * ```ts
  * const emit = defineEmits<{
- *   (event: 'change'): void
- *   (event: 'update', id: number): void
+ *   // <eventName>: <expected arguments>
+ *   change: []
+ *   update: [value: string] // named tuple syntax
  * }>()
  *
  * emit('change')