Skip to content

Commit

Permalink
docs: Fix bad alias usage in assets examples (#1443)
Browse files Browse the repository at this point in the history
  • Loading branch information
aklinker1 authored Feb 16, 2025
1 parent 44dab37 commit 80ca576
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions docs/guide/essentials/assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ img.src = imageUrl;
```

```html [HTML]
<img src="~/assets/image.png" />
<!-- In HTML tags, you must use the relative path --->
<img src="../assets/image.png" />
```

```css [CSS]
Expand All @@ -25,6 +26,22 @@ img.src = imageUrl;
}
```

```vue [Vue]
<script>
import image from '~/assets/image.png';
</script>
<template>
<img :src="image" />
</template>
```

```jsx [JSX]
import image from '~/assets/image.png';

<img src={image} />;
```

:::

## `/public` Directory
Expand Down Expand Up @@ -52,6 +69,16 @@ img.src = imageUrl;
}
```

```vue [Vue]
<template>
<img src="/image.png" />
</template>
```

```jsx [JSX]
<img src="/image.png" />
```

:::

## Inside Content Scripts
Expand Down Expand Up @@ -114,7 +141,7 @@ export default defineConfig({
manifest: {
web_accessible_resources: [
{
// We'll use this matches in the cotent script as well
// We'll use this matches in the content script as well
matches: ['*://*.github.com/*'],
// Use the same path as `relativeDest` from the WXT module
resources: ['/oxc_parser_wasm_bg.wasm'],
Expand Down

0 comments on commit 80ca576

Please sign in to comment.