aboutsummaryrefslogtreecommitdiff
path: root/src/hocs/with_load_more
diff options
context:
space:
mode:
authortaehoon <th.dev91@gmail.com>2019-02-14 03:12:52 -0500
committertaehoon <th.dev91@gmail.com>2019-02-20 13:30:31 -0500
commit8680046c4e59e2296de6add1237f59745aa49e03 (patch)
tree5eaad1d17730ed2f1f0bbf9f05b3dced05716874 /src/hocs/with_load_more
parent6d4d705c51a3d39e4de22a3320cfa61ef63a0066 (diff)
Pass down slots into wrapped components
Diffstat (limited to 'src/hocs/with_load_more')
-rw-r--r--src/hocs/with_load_more/with_load_more.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/hocs/with_load_more/with_load_more.js b/src/hocs/with_load_more/with_load_more.js
index 459e026c..e9265d2a 100644
--- a/src/hocs/with_load_more/with_load_more.js
+++ b/src/hocs/with_load_more/with_load_more.js
@@ -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"/>}