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>