β¬ οΈ Back to Table of Contents
π useFavicon¶
π Analysis Summary¶
| Metric | Count |
|---|---|
| π§ Functions | 2 |
| π¦ Imports | 9 |
| π’ Vue Composition API | 1 |
| π Interfaces | 1 |
| π Type Aliases | 1 |
π Table of Contents¶
π οΈ File Location:¶
π packages/core/useFavicon/index.ts
π¦ Imports¶
| Name | Source |
|---|---|
ReadonlyRefOrGetter |
@vueuse/shared |
ComputedRef |
vue |
MaybeRef |
vue |
MaybeRefOrGetter |
vue |
Ref |
vue |
ConfigurableDocument |
../_configurable |
toRef |
@vueuse/shared |
watch |
vue |
defaultDocument |
../_configurable |
Vue Composition API¶
| Name | Type | Reactive Variables | Composables |
|---|---|---|---|
watch |
watch | none | none |
Functions¶
useFavicon(newIcon: ReadonlyRefOrGetter<string | null | undβ¦, options: UseFaviconOptions): ComputedRef<string | null | undefined>¶
Reactive favicon.
Parameters:
newIconany: No descriptionoptionsany: No description
See: https://vueuse.org/useFavicon
Raw JSDoc
Code
Internal helpers¶
Declared inside another function in this file.
applyIcon(icon: string): void¶
Parameters:
iconstring
Returns: void
Calls:
document?.head .querySelectorAlldocument?.createElementicon.split('.').popdocument?.head.appendelements?.forEach
Code
(icon: string) => {
const elements = document?.head
.querySelectorAll<HTMLLinkElement>(`link[rel*="${rel}"]`)
if (!elements || elements.length === 0) {
const link = document?.createElement('link')
if (link) {
link.rel = rel
link.href = `${baseUrl}${icon}`
link.type = `image/${icon.split('.').pop()}`
document?.head.append(link)
}
return
}
elements?.forEach(el => el.href = `${baseUrl}${icon}`)
}
Interfaces¶
UseFaviconOptions¶
Interface Code
Properties¶
| Name | Type | Optional | Description |
|---|---|---|---|
baseUrl |
string |
β | not shown |
rel |
string |
β | not shown |
Type Aliases¶
UseFaviconReturn¶
Generated by Syntax Scribe