其他分享
首页 > 其他分享> > vue-lazyload延迟加载

vue-lazyload延迟加载

作者:互联网

cnpm install vue-lazyload --save
import Lazyload from 'vue-lazyload'
Vue.use(Lazyload)
<template>
  <div id="app">
    <!-- <img src="./assets/logo.png"> -->
    <!-- <img :src="imgUrl"> -->
    <img v-lazy="imgUrl">
  </div>
</template>

<script>
  export default {
    name: 'App',
    data() {
      return {
        msg: 'hello App'
      }
    },
    computed: {
      imgUrl() {
        return require("./assets/logo.png");
      }
    },
  }
</script>

标签:vue,return,lazyload,--,App,Lazyload,加载
来源: https://www.cnblogs.com/zhangxuechao/p/15045978.html