Update hocs to pass parent-scope bindings to the wrapped component

This commit is contained in:
taehoon 2019-02-13 20:59:26 -05:00
parent 52913d8f87
commit 8270274865
2 changed files with 33 additions and 20 deletions

View file

@ -12,15 +12,18 @@ const withList = (Component, getEntryProps = defaultEntryPropsGetter, getKey = d
{map(this.entries, (entry, index) => {
const props = {
key: getKey(entry, index),
...this.$props.entryProps,
...getEntryProps(entry, index)
props: {
...this.$props.entryProps,
...getEntryProps(entry, index)
},
on: this.$props.entryListeners
}
return <Component {...{ attrs: props }} />
return <Component {...props} />
})}
</div>
)
},
props: ['entries', 'entryProps']
props: ['entries', 'entryProps', 'entryListeners']
})
}