0
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で外部のURLからイメージを表示する(仮?)方法備忘録

Posted at

前提条件

以下のサイトを参考に作ったが、エラーになった。(module.exportsに domain挿入)

したこと

以下の説明を参考に、srcにURLを入れるのではなく、loader引数にURLを返す関数を入れる。
引数でsrcを利用できるので利用した方がおそらく適切。(外部イメージ名がsrcと違っても動いたので例の表示はこれにしています)

~~.js
<Image
    loader={()=>"https://example.com/image.png"}
    width="400"
    height="350"
    src="me.png"
    alt="no image" />

※ もっと適切な方法があるかもしれないので注意して利用してください。

0
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
0
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?