最近用vue做项目,用到了瀑布流vue-waterfall,其中遇到高度的设置问题,大概介绍下,希望可以帮到一些人
1、安装
npm install --save vue-waterfall
2、引入
ES6
* in xxx.vue */
/*
* or use ES5 code (vue-waterfall.min.js) :
* import { Waterfall, WaterfallSlot } from 'vue-waterfall'
*/
...
components:
Waterfall
WaterfallSlot
...
}
ES5
var Vue =
var Waterfall =
var YourComponent = Vue
3、Browser
or
...
components:
'waterfall': Waterfall
'waterfall-slot': Waterfall
...
HTML structure
<!-- each component is wrapped by a waterfall slot -->
<!--
your component
-->
Props
waterfall
waterfall-slot
name | default | description |
---|---|---|
width | - | Required. The width of slot. |
height | - | Required. The height of slot. |
order | 0 |
The order of slot, often be set to index in v-for . |
key | '' |
The unique identification of slot, required for transition. |
move-class | - | Class for transition. see vue-animated-list . |