Pass down slots into wrapped components
This commit is contained in:
parent
6d4d705c51
commit
8680046c4e
2 changed files with 36 additions and 18 deletions
|
@ -18,11 +18,15 @@ const withLoadMore = ({
|
|||
...this.$props,
|
||||
[childPropName]: this.entries
|
||||
},
|
||||
on: this.$listeners
|
||||
on: this.$listeners,
|
||||
scopedSlots: this.$scopedSlots
|
||||
}
|
||||
const children = Object.keys(this.$slots).map(slot => createElement('template', { slot }, this.$slots[slot]))
|
||||
return (
|
||||
<div class="with-load-more">
|
||||
<WrappedComponent {...props} />
|
||||
<WrappedComponent {...props}>
|
||||
{children}
|
||||
</WrappedComponent>
|
||||
<div class="with-load-more-footer">
|
||||
{this.error && <a onClick={this.fetchEntries} class="alert error">{this.$t('general.generic_error')}</a>}
|
||||
{!this.error && this.loading && <i class="icon-spin3 animate-spin"/>}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue