Pulled ALL skills from 15 source repositories: - anthropics/skills: 16 (docs, design, MCP, testing) - obra/superpowers: 14 (TDD, debugging, agents, planning) - coreyhaines31/marketingskills: 25 (marketing, CRO, SEO, growth) - better-auth/skills: 5 (auth patterns) - vercel-labs/agent-skills: 5 (React, design, Vercel) - antfu/skills: 16 (Vue, Vite, Vitest, pnpm, Turborepo) - Plus 13 individual skills from various repos Mosaic Stack is not limited to coding — the Orchestrator and subagents serve coding, business, design, marketing, writing, logistics, analysis, and more. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
56 lines
1.2 KiB
Markdown
56 lines
1.2 KiB
Markdown
---
|
|
category: Browser
|
|
---
|
|
|
|
# useObjectUrl
|
|
|
|
Reactive URL representing an object.
|
|
|
|
Creates an URL for the provided `File`, `Blob`, or `MediaSource` via [URL.createObjectURL()](https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL) and automatically releases the URL via [URL.revokeObjectURL()](https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL) when the source changes or the component is unmounted.
|
|
|
|
## Usage
|
|
|
|
```vue
|
|
<script setup lang="ts">
|
|
import { useObjectUrl } from '@vueuse/core'
|
|
import { shallowRef } from 'vue'
|
|
|
|
const file = shallowRef()
|
|
const url = useObjectUrl(file)
|
|
|
|
function onFileChange(event) {
|
|
file.value = event.target.files[0]
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<input type="file" @change="onFileChange">
|
|
|
|
<a :href="url">Open file</a>
|
|
</template>
|
|
```
|
|
|
|
## Component Usage
|
|
|
|
```vue
|
|
<template>
|
|
<UseObjectUrl v-slot="url" :object="file">
|
|
<a :href="url">Open file</a>
|
|
</UseObjectUrl>
|
|
</template>
|
|
```
|
|
|
|
## Type Declarations
|
|
|
|
```ts
|
|
/**
|
|
* Reactive URL representing an object.
|
|
*
|
|
* @see https://vueuse.org/useObjectUrl
|
|
* @param object
|
|
*/
|
|
export declare function useObjectUrl(
|
|
object: MaybeRefOrGetter<Blob | MediaSource | null | undefined>,
|
|
): Readonly<Ref<string | undefined, string | undefined>>
|
|
```
|