It has been referenced {{ usageCount }} times by:
diff --git a/packages/devtools/client/components/ServerRouteDetails.vue b/packages/devtools/client/components/ServerRouteDetails.vue
index c76d415b0..c0b870bab 100644
--- a/packages/devtools/client/components/ServerRouteDetails.vue
+++ b/packages/devtools/client/components/ServerRouteDetails.vue
@@ -153,14 +153,14 @@ ${items.join(',\n').split('\n').map(line => ` ${line}`).join('\n')}
snippets.push({
name: 'useFetch',
lang: 'javascript',
- docs: 'https://nuxt.com/docs/api/composables/use-fetch',
+ docs: ComposablesDocs.nuxt.useFetch,
code: `const { data, pending, error, refresh } = useFetch('${finalPath.value}'${options})`,
})
snippets.push({
name: '$fetch',
lang: 'javascript',
- docs: 'https://nuxt.com/docs/api/utils/dollarfetch#fetch',
+ docs: ComposablesDocs.nuxt.$fetch,
code: `await $fetch('${finalPath.value}'${options})`,
})
@@ -284,7 +284,10 @@ const methods = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD']
-
+
Add
diff --git a/packages/devtools/client/composables/constants.ts b/packages/devtools/client/composables/constants.ts
index a1edee087..0df17e34c 100644
--- a/packages/devtools/client/composables/constants.ts
+++ b/packages/devtools/client/composables/constants.ts
@@ -1 +1,54 @@
export const DETAILS_MAX_ITEMS = 20
+
+export const ComposablesDocs = {
+ nuxt: {
+ // composables
+ useAppConfig: 'https://nuxt.com/docs/api/composables/use-app-config',
+ useAsyncData: 'https://nuxt.com/docs/api/composables/use-async-data',
+ useCookie: 'https://nuxt.com/docs/api/composables/use-cookie',
+ useError: 'https://nuxt.com/docs/api/composables/use-error',
+ useFetch: 'https://nuxt.com/docs/api/composables/use-fetch',
+ useHead: 'https://nuxt.com/docs/api/composables/use-head',
+ useHeadSafe: 'https://nuxt.com/docs/api/composables/use-head-safe',
+ useLazyAsyncData: 'https://nuxt.com/docs/api/composables/use-lazy-async-data',
+ useLazyFetch: 'https://nuxt.com/docs/api/composables/use-lazy-fetch',
+ useNuxtApp: 'https://nuxt.com/docs/api/composables/use-nuxt-app',
+ useRoute: 'https://nuxt.com/docs/api/composables/use-route',
+ useRouter: 'https://nuxt.com/docs/api/composables/use-router',
+ useRuntimeConfig: 'https://nuxt.com/docs/api/composables/use-runtime-config',
+ useState: 'https://nuxt.com/docs/api/composables/use-state',
+
+ // utils
+ $fetch: 'https://nuxt.com/docs/api/utils/dollarfetch',
+ abortNavigation: 'https://nuxt.com/docs/api/utils/abort-navigation',
+ createError: 'https://nuxt.com/docs/api/utils/create-error',
+ defineNuxtComponent: 'https://nuxt.com/docs/api/utils/define-nuxt-component',
+ definePageMeta: 'https://nuxt.com/docs/api/utils/define-page-meta',
+ navigateTo: 'https://nuxt.com/docs/api/utils/navigate-to#navigateto',
+ onBeforeRouteLeave: 'https://nuxt.com/docs/api/utils/on-before-route-leave',
+ onBeforeRouteUpdate: 'https://nuxt.com/docs/api/utils/on-before-route-update',
+ updateAppConfig: 'https://nuxt.com/docs/api/utils/update-app-config',
+ },
+ vue: {
+ // reactivity
+ ref: 'https://vuejs.org/api/reactivity-core.html#ref',
+ computed: 'https://vuejs.org/api/reactivity-core.html#computed',
+ reactive: 'https://vuejs.org/api/reactivity-core.html#reactive',
+ watch: 'https://vuejs.org/api/reactivity-core.html#watch',
+ watchEffect: 'https://vuejs.org/api/reactivity-core.html#watcheffect',
+ watchPostEffect: 'https://vuejs.org/api/reactivity-core.html#watchposteffect',
+ watchSyncEffect: 'https://vuejs.org/api/reactivity-core.html#watchsynceffect',
+
+ // lifecycle
+ onMounted: 'https://vuejs.org/api/composition-api-lifecycle.html#onmounted',
+ onUnmounted: 'https://vuejs.org/api/composition-api-lifecycle.html#onunmounted',
+ onActivated: 'https://vuejs.org/api/composition-api-lifecycle.html#onactivated',
+ onDeactivated: 'https://vuejs.org/api/composition-api-lifecycle.html#ondeactivated',
+ onBeforeMount: 'https://vuejs.org/api/composition-api-lifecycle.html#onbeforemount',
+ onBeforeUnmount: 'https://vuejs.org/api/composition-api-lifecycle.html#onbeforeunmount',
+ onUpdated: 'https://vuejs.org/api/composition-api-lifecycle.html#onupdated',
+ onBeforeUpdate: 'https://vuejs.org/api/composition-api-lifecycle.html#onbeforeupdate',
+
+ nextTick: 'https://vuejs.org/api/general.html#nexttick',
+ },
+}