3
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 5 years have passed since last update.

vue.js で v-lazy img

3
Posted at

vue.jsを使っているときに lazyload をしたい時がある。

参考
https://github.com/hilongjw/vue-lazyload

画像を直接指定


<div v-lazy-container="{ selector: 'img' }">
    <img data-src="/img/info1.png">
</div>

ループ の中で使う


<ul>
  <li v-for="img in list">
    <img v-lazy="img.src" >
  </li>
</ul>

こんな感じでどちらでも使うことができる。

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