<style lang="SCSS scoped>";
</style>
<script>
Import vueWaterfallEasy from vue - waterfall - "easy".
Export the default {
Components: {
VueWaterfallEasy
},
Data () {
Return {
ImgsArr: [],//to hold all have loaded pictures array
FetchImgsArr: []//to hold each scroll nowadays a batch of images need to be loaded array
};
},
Methods: {
InitImgsArr (n, m) {
//initialize the image array, the method of load to load picture
in the arrayThe console. The log (" performed initImgsArr method ");
var arr=[];
For (var I=n; I & lt; m; I++) {
Arr. Push ({
SRC: the require (`../static/img/${I + 1} the. JPG `),//storing the addresses of the picture
Info: "this is a picture//store the description of the picture
});
}
Return arr.
},
FetchImgsData () {
//get new method of image data, for the rolling satisfy the conditions when the page
The console. The log (" performed fetchImgsData method ");
Enclosing imgsArr=this. ImgsArr. Concat (enclosing fetchImgsArr);
}
},
Created () {
The console. The log (" performed created method ");
Enclosing imgsArr=this. InitImgsArr (0, 6);//initialize the first load 6 picture
Enclosing fetchImgsArr=this. InitImgsArr (7, 13);//simulation under a new image of array data
The console. The log (1, enclosing imgsArr, 2, enclosing fetchImgsArr);
}
};
</script>
For years, have a look, why not normal picture?
Make the most of the day...
CodePudding user response:
Changing the position of the vue - waterfall - easy to can see the pictures after fixedCodePudding user response:
Inside source change? That should change a lot of places ahCodePudding user response: