Skip to content

Commit 80ca576

Browse files
authored
docs: Fix bad alias usage in assets examples (#1443)
1 parent 44dab37 commit 80ca576

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

docs/guide/essentials/assets.md

+29-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ img.src = imageUrl;
1616
```
1717

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

2223
```css [CSS]
@@ -25,6 +26,22 @@ img.src = imageUrl;
2526
}
2627
```
2728

29+
```vue [Vue]
30+
<script>
31+
import image from '~/assets/image.png';
32+
</script>
33+
34+
<template>
35+
<img :src="image" />
36+
</template>
37+
```
38+
39+
```jsx [JSX]
40+
import image from '~/assets/image.png';
41+
42+
<img src={image} />;
43+
```
44+
2845
:::
2946

3047
## `/public` Directory
@@ -52,6 +69,16 @@ img.src = imageUrl;
5269
}
5370
```
5471

72+
```vue [Vue]
73+
<template>
74+
<img src="/image.png" />
75+
</template>
76+
```
77+
78+
```jsx [JSX]
79+
<img src="/image.png" />
80+
```
81+
5582
:::
5683

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

0 commit comments

Comments
 (0)