Use Object.entries instead of Object.keys

This commit is contained in:
taehoon 2019-02-20 21:50:10 -05:00
parent 37eec09b9b
commit eb22e7f462
2 changed files with 2 additions and 2 deletions

View file

@ -21,7 +21,7 @@ const withLoadMore = ({
on: this.$listeners,
scopedSlots: this.$scopedSlots
}
const children = Object.keys(this.$slots).map(slot => createElement('template', { slot }, this.$slots[slot]))
const children = Object.entries(this.$slots).map(([key, value]) => createElement('template', { slot: key }, value))
return (
<div class="with-load-more">
<WrappedComponent {...props}>

View file

@ -27,7 +27,7 @@ const withSubscription = ({
on: this.$listeners,
scopedSlots: this.$scopedSlots
}
const children = Object.keys(this.$slots).map(slot => createElement('template', { slot }, this.$slots[slot]))
const children = Object.entries(this.$slots).map(([key, value]) => createElement('template', { slot: key }, value))
return (
<div class="with-subscription">
<WrappedComponent {...props}>