Skip to content

Commit c8dfe2d

Browse files
committed
Support rclass and wclass to allow setting classes on the root and item wrappers. #13
1 parent bf0be12 commit c8dfe2d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ new Vue({
110110
| remain | Number || How many items should be shown in virtual-list viewport, so `size` and `remain` will determine the virtual-list outside container height (size × remian). |
111111
| start | Number | * | Default value is `0`, the initial scroll start index. It must be integer and in the range of list index, throws a warning if index does not exist. |
112112
| rtag | String | * | Default value is `div`, the virtual-list's root HTMLElement tag name, in all case it's style is set to `display: block;` |
113-
| rtagClass | String | * | Default value is an empty string, the virtual-list's root HTMLElement tag's classes. Has the same API has [`v-bind:class`](https://vuejs.org/v2/guide/class-and-style.html) |
113+
| rclass | String | * | Default value is an empty string, the virtual-list's root HTMLElement tag's classes. Has the same API has [`v-bind:class`](https://vuejs.org/v2/guide/class-and-style.html) |
114114
| wtag | String | * | Default value is `div`, the virtual-list's item wrapper HTMLElement tag name, in all case it's style is set to `display: block;` |
115-
| wtagClass | String | * | Default value is an empty string, the virtual-list's item wrapper HTMLElement tag's classes. Has the same API has [`v-bind:class`](https://vuejs.org/v2/guide/class-and-style.html) |
115+
| wclass | String | * | Default value is an empty string, the virtual-list's item wrapper HTMLElement tag's classes. Has the same API has [`v-bind:class`](https://vuejs.org/v2/guide/class-and-style.html) |
116116
| onscroll | Function | * | Called when virtual-list scroll event handling, param: `(e, scrollTop)`. |
117117
| totop | Function | * | Called when the virtual-list is scrolled to top. |
118118
| tobottom | Function | * | Called when the virtual-list is scrolled to bottom. |

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
size: { type: Number, required: true },
2121
remain: { type: Number, required: true },
2222
rtag: { type: String, default: 'div' },
23-
rtagClass: { type: String, default: '' },
23+
rclass: { type: String, default: '' },
2424
wtag: { type: String, default: 'div' },
25-
wtagClass: { type: String, default: '' },
25+
wclass: { type: String, default: '' },
2626
start: { type: Number, default: 0 },
2727
totop: Function,
2828
tobottom: Function,
@@ -216,15 +216,15 @@
216216
'on': {
217217
'scroll': this.handleScroll
218218
},
219-
'class': this.rtagClass
219+
'class': this.rclass
220220
}, [
221221
createElement(this.wtag, {
222222
'style': {
223223
'display': 'block',
224224
'padding-top': delta.paddingTop + 'px',
225225
'padding-bottom': delta.allPadding - delta.paddingTop + 'px'
226226
},
227-
'class': this.wtagClass
227+
'class': this.wclass
228228
}, showList)
229229
])
230230
}

0 commit comments

Comments
 (0)