Authored by ccbikai

add lazyload

const Vue = require('yoho-vue');
const lazyload = require('yoho-vue-lazyload');
const tab = require('channel/tab.vue');
const resources = require('channel/resources.vue');
require('common/vue-filter');
Vue.use(lazyload, {
try: 2
});
new Vue({
el: '#app',
components: {
... ...
<template>
<div class="focus-left-right">
<a v-for="item in floor" href="{{item.url}}" title="{{item.title}}">
<img v-bind:src="item.src | resize 250 250">
<img v-lazy="item.src | resize 250 250">
</a>
</div>
</template>
... ...
... ... @@ -3,7 +3,7 @@
<swipe class="swipe swipe-{{floor.length}}">
<swipe-item v-for="item in floor" v-bind:style="{backgroundColor: item.bgColor}">
<a href="{{item.url}}" title="{{item.title}}">
<img v-bind:src="item.src | resize 750 365">
<img v-lazy="item.src | resize 750 365">
</a>
</swipe-item>
</swipe>
... ...
<template>
<div class="recommend-content-five">
<a v-for="item in floor" href="{{item.url}}" title="{{item.title}}">
<img v-bind:src="item.src | resize 375 375">
<img v-lazy="item.src | resize 375 375">
</a>
</div>
</template>
... ...
... ... @@ -2,7 +2,7 @@
<div class="title-image">
<title-floor v-bind:title="{name: floor.title, moreName: floor.moreName, moreUrl: floor.moreUrl}"></title-floor>
<a class="image" v-bind:href="floor.image.url">
<img v-bind:src="floor.image.src | resize 750 364">
<img v-lazy="floor.image.src | resize 750 364">
</a>
</div>
</template>
... ...