diff --git a/README.md b/README.md
index 0b1c282..460be77 100644
--- a/README.md
+++ b/README.md
@@ -317,6 +317,12 @@ More usages or getting start you can refer to these clearly [examples](https://g
{} |
For using using footer slot, footer slot wrapper element inline style. |
+
+ scoped-slots |
+ Object |
+ {} |
+ $scopedSlots for item component |
+
diff --git a/src/index.js b/src/index.js
index 8ca3b82..540a995 100644
--- a/src/index.js
+++ b/src/index.js
@@ -263,7 +263,7 @@ const VirtualList = Vue.component('virtual-list', {
getRenderSlots (h) {
const slots = []
const { start, end } = this.range
- const { dataSources, dataKey, itemClass, itemTag, itemStyle, isHorizontal, extraProps, dataComponent } = this
+ const { dataSources, dataKey, itemClass, itemTag, itemStyle, isHorizontal, extraProps, dataComponent, scopedSlots } = this
for (let index = start; index <= end; index++) {
const dataSource = dataSources[index]
if (dataSource) {
@@ -277,7 +277,8 @@ const VirtualList = Vue.component('virtual-list', {
uniqueKey: dataSource[dataKey],
source: dataSource,
extraProps: extraProps,
- component: dataComponent
+ component: dataComponent,
+ scopedSlots: scopedSlots
},
style: itemStyle,
class: `${itemClass}${this.itemClassAdd ? ' ' + this.itemClassAdd(index) : ''}`
diff --git a/src/item.js b/src/item.js
index 023a13d..0141f05 100644
--- a/src/item.js
+++ b/src/item.js
@@ -51,7 +51,7 @@ export const Item = Vue.component('virtual-list-item', {
props: ItemProps,
render (h) {
- const { tag, component, extraProps = {}, index } = this
+ const { tag, component, extraProps = {}, index, scopedSlots = {} } = this
extraProps.source = this.source
extraProps.index = index
@@ -60,7 +60,8 @@ export const Item = Vue.component('virtual-list-item', {
role: 'item'
}
}, [h(component, {
- props: extraProps
+ props: extraProps,
+ scopedSlots: scopedSlots
})])
}
})
diff --git a/src/props.js b/src/props.js
index 96fc35c..2c8a919 100644
--- a/src/props.js
+++ b/src/props.js
@@ -102,6 +102,9 @@ export const VirtualProps = {
},
footerStyle: {
type: Object
+ },
+ scopedSlots: {
+ type: Object
}
}
@@ -129,6 +132,9 @@ export const ItemProps = {
},
extraProps: {
type: Object
+ },
+ scopedSlots: {
+ type: Object
}
}