Skip to content

Commit

Permalink
docs: clarify src origin (nuxt#318)
Browse files Browse the repository at this point in the history
* docs: clarify src origin

* docs: add static docs reference
  • Loading branch information
bencodezen authored Jun 11, 2021
1 parent d1e65b8 commit 758ec42
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/pages/en/2.components/1.nuxt-img.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ description: Discover how to use and configure the nuxt-img component.
- Generates responsive sizes when providing `sizes` option
- Supports native lazy loading as well as other `<img>` attributes

## Usage

`nuxt-img` outputs a native `img` tag directly (without any wrapper around it). Use it like you would use the `<img>` tag:

```html
Expand All @@ -23,6 +25,16 @@ Will result in:
<img src="/nuxt-icon.png" />
```

### File Location

Images should be stored in the `static` directory.

For example, the `nuxt-icon.png` referred to in the previous example should be placed in `static` folder under the path `/static/nuxt-icon.png`.

In other words, image stored in the `assets` directory are not compatible with Nuxt Image because those images are managed by webpack.

For more information, you can learn more about the [static directory here](https://nuxtjs.org/docs/2.x/directory-structure/static).

## Props

### `src`
Expand Down

0 comments on commit 758ec42

Please sign in to comment.