1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Nuxt.js】Nuxt.jsでの画像の指定方法

Posted at

画像の格納場所

2通りがあります。

  • /assets
  • /static

格納場所の使い分け

webpackのモジュールとして扱いたい

この場合は /assets に画像を保管

<img src="~/assets/my-image-2.png" />

静的画像として扱いたい(webpackしたくない)

この場合は /static に画像を保管

<img src="/my-image.png" />

■参考にしたサイト
https://nuxtjs.org/docs/directory-structure/static/

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?