LoginSignup
1
0

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