β¬ οΈ Back to Table of Contents
π useTitle¶
π Analysis Summary¶
| Metric | Count |
|---|---|
| π§ Functions | 2 |
| π¦ Imports | 12 |
| π’ Vue Composition API | 1 |
| π Type Aliases | 3 |
π Table of Contents¶
π οΈ File Location:¶
π packages/core/useTitle/index.ts
π¦ Imports¶
| Name | Source |
|---|---|
ReadonlyRefOrGetter |
@vueuse/shared |
ComputedRef |
vue |
MaybeRef |
vue |
MaybeRefOrGetter |
vue |
Ref |
vue |
ConfigurableDocument |
../_configurable |
toRef |
@vueuse/shared |
tryOnScopeDispose |
@vueuse/shared |
toValue |
vue |
watch |
vue |
defaultDocument |
../_configurable |
useMutationObserver |
../useMutationObserver |
Vue Composition API¶
| Name | Type | Reactive Variables | Composables |
|---|---|---|---|
watch |
watch | none | none |
Functions¶
useTitle(newTitle: ReadonlyRefOrGetter<string | null | undβ¦, options: UseTitleOptions): ComputedRef<string | null | undefined>¶
Reactive document title.
Parameters:
newTitleany: No descriptionoptionsany: No description
See: https://vueuse.org/useTitle
Tags: @description It's not SSR compatible. Your value will be applied only on client-side.
Raw JSDoc
Code
Internal helpers¶
Declared inside another function in this file.
format(t: string): any¶
Parameters:
tstring
Returns: any
Calls:
templatetoValue(template).replace
Code
Type Aliases¶
UseTitleOptionsBase¶
type UseTitleOptionsBase = {
/**
* Restore the original title when unmounted
* @param originTitle original title
* @returns restored title
*/
restoreOnUnmount?: false | ((originalTitle: string, currentTitle: string) => string | null | undefined)
} & (
{
/**
* Observe `document.title` changes using MutationObserve
* Cannot be used together with `titleTemplate` option.
*
* @default false
*/
observe?: boolean
}
| {
/**
* The template string to parse the title (e.g., '%s | My Website')
* Cannot be used together with `observe` option.
*
* @default '%s'
*/
titleTemplate?: MaybeRef<string> | ((title: string) => string)
}
);
UseTitleOptions¶
UseTitleReturn¶
Generated by Syntax Scribe