64 |
69 | {{ item.title }}
70 |
71 |
72 |
77 | {{ item.value }}
78 |
79 |
80 | ```
81 |
82 | ### Height Types
83 |
84 | ### static
85 | Each slot must have size set in the css, which must be equal to size set in `itemHeight` option.
86 |
87 | ### dynamic
88 | Each item in the list must have property (`heightField`) with the exact height of the slot for that item.
89 |
90 | ### automatic
91 | Size of slot is automaticaly calculated when rendered and set to `heightField` property of the item.
92 |
93 | For dynamic/automatic types, the `itemHeight` option is used as estimate. It's **strongly recommended** to use it.
94 |
95 | ## Options
96 |
97 | ### items
98 | Type: `Array`, Required
99 |
100 | List of items to display.
101 |
102 | ### columns
103 | Type: `Number`, Default: `1`
104 |
105 | Number of columns per row.
106 |
107 | ### itemHeight
108 | Type: `Number`, Default: `100`
109 |
110 | Height of the row.
111 |
112 | ### typeField
113 | Type: `String`, Default: `type`
114 |
115 | Item property's name for type.
116 |
117 | ### heightField
118 | Type: `String`, Default: `height`
119 |
120 | Item property's name for height.
121 |
122 | ### heightType
123 | Type: `String`, Default: `static`, Options: `static`, `dynamic`, `automatic`
124 |
125 | ### inset
126 | Type: `Object`, Default: `{top: 0, bottom: 0}`
127 |
128 | Inset from top and bottom of the list.
129 |
130 | ### scrollPastEnd
131 | Type: `Number`, Default: `0`
132 |
133 | Renders space at the end of the list of size `height` * `scrollPastEnd`.
134 |
135 | `0.5` = 50% of height
136 |
137 | ### buffer
138 | Type: `Number`, Default: `200`
139 |
140 | Pixels to pre-render around visible area.
141 |
142 | ### threshold
143 | Type: `Number`, Default: `50`
144 |
145 | Threshold for `scrollToTop` & `scrollToBottom` events.
146 |
147 | ### autoResize
148 | Type: `Boolean`, Default: `true`
149 |
150 | Sets whether the list should auto resize and render items when window resizes.
151 |
152 |
153 | ## Events
154 |
155 | ### cellsChange
156 | Emitted when visible/rendered cells change. There is one argument with list of cells.
157 |
158 | ### scrollToTop
159 |
160 | ### scrollToBottom
161 |
162 | ## Methods
163 |
164 | ### isAtTop()
165 | Return: `Boolean`
166 |
167 | Is list at the top?
168 |
169 | ### isAtBottom()
170 | Return: `Boolean`
171 |
172 | Is list at the bottom?
173 |
174 | ### scrollTo(index, position)
175 | index: `Int`, position: `default|top|bottom|topInset|bottomInset'`
176 |
177 | Scrolls to specified index at position.
178 |
179 | ### scrollToBottom()
180 | Scrolls to bottom of list.
181 |
182 | ### resizeItem(index)
183 | index: `Int`
184 |
185 | Should be called whenever item with dynamic height did change height.
186 |
187 |
188 | ---
189 |
190 | ## Example
191 |
192 | ```html
193 |