]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: add docs links for sfc macros
authorEvan You <yyx990803@gmail.com>
Sun, 2 Apr 2023 02:02:33 +0000 (10:02 +0800)
committerEvan You <yyx990803@gmail.com>
Sun, 2 Apr 2023 02:02:33 +0000 (10:02 +0800)
packages/runtime-core/src/apiSetupHelpers.ts

index 31307aa7e75d49f36d254581d6e6db2f5ce7d7db..239246a33ead3595d87ece494e6191ae36ead320 100644 (file)
@@ -59,6 +59,8 @@ 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
@@ -118,6 +120,8 @@ type BooleanKey<T, K extends keyof T = keyof T> = K extends any
  *
  * This is only usable inside `<script setup>`, is compiled away in the
  * output and should **not** be actually called at runtime.
+ *
+ * @see {@link https://vuejs.org/api/sfc-script-setup.html#defineprops-defineemits}
  */
 // overload 1: runtime emits w/ array
 export function defineEmits<EE extends string = string>(
@@ -156,6 +160,8 @@ type ShortEmits<T extends Record<string, any>> = UnionToIntersection<
  *
  * This is only usable inside `<script setup>`, is compiled away in the
  * output and should **not** be actually called at runtime.
+ *
+ * @see {@link https://vuejs.org/api/sfc-script-setup.html#defineexpose}
  */
 export function defineExpose<
   Exposed extends Record<string, any> = Record<string, any>
@@ -165,6 +171,13 @@ export function defineExpose<
   }
 }
 
+/**
+ * Vue `<script setup>` compiler macro for declaring a component's additional
+ * options. This should be used only for options that cannot be expressed via
+ * Composition API - e.g. `inhertiAttrs`.
+ *
+ * @see {@link https://vuejs.org/api/sfc-script-setup.html#defineoptions}
+ */
 export function defineOptions<
   RawBindings = {},
   D = {},
@@ -232,6 +245,8 @@ type PropsWithDefaults<Base, Defaults> = Base & {
  *
  * This is only usable inside `<script setup>`, is compiled away in the output
  * and should **not** be actually called at runtime.
+ *
+ * @see {@link https://vuejs.org/guide/typescript/composition-api.html#typing-component-props}
  */
 export function withDefaults<Props, Defaults extends InferDefaults<Props>>(
   props: Props,