diff options
| author | taehoon <th.dev91@gmail.com> | 2019-02-25 04:18:41 -0500 |
|---|---|---|
| committer | taehoon <th.dev91@gmail.com> | 2019-02-28 12:40:22 -0500 |
| commit | cb383df517dc5cd5b4d90136b533977a33611b71 (patch) | |
| tree | 7224543730bab2e56128cee2a89cac2aae91e7d6 /src/hocs | |
| parent | 5c43374588b810bf1ba8b74414867d0324b3c59f (diff) | |
Fix bug to get wrapped component prop name list
Diffstat (limited to 'src/hocs')
| -rw-r--r-- | src/hocs/with_load_more/with_load_more.js | 3 | ||||
| -rw-r--r-- | src/hocs/with_subscription/with_subscription.js | 3 |
2 files changed, 4 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 a521014c..7d53e7ac 100644 --- a/src/hocs/with_load_more/with_load_more.js +++ b/src/hocs/with_load_more/with_load_more.js @@ -1,6 +1,7 @@ import Vue from 'vue' import filter from 'lodash/filter' import isEmpty from 'lodash/isEmpty' +import { getComponentProps } from '../../services/component_utils/component_utils' import './with_load_more.scss' const withLoadMore = ({ @@ -9,7 +10,7 @@ const withLoadMore = ({ childPropName = 'entries', // name of the prop to be passed into the wrapped component additionalPropNames = [] // additional prop name list of the wrapper component }) => (WrappedComponent) => { - const originalProps = WrappedComponent.props || [] + const originalProps = Object.keys(getComponentProps(WrappedComponent)) const props = filter(originalProps, v => v !== childPropName).concat(additionalPropNames) return Vue.component('withLoadMore', { diff --git a/src/hocs/with_subscription/with_subscription.js b/src/hocs/with_subscription/with_subscription.js index b6bc8358..4d3ae811 100644 --- a/src/hocs/with_subscription/with_subscription.js +++ b/src/hocs/with_subscription/with_subscription.js @@ -1,6 +1,7 @@ import Vue from 'vue' import filter from 'lodash/filter' import isEmpty from 'lodash/isEmpty' +import { getComponentProps } from '../../services/component_utils/component_utils' import './with_subscription.scss' const withSubscription = ({ @@ -9,7 +10,7 @@ const withSubscription = ({ childPropName = 'content', // name of the prop to be passed into the wrapped component additionalPropNames = [] // additional prop name list of the wrapper component }) => (WrappedComponent) => { - const originalProps = WrappedComponent.props || [] + const originalProps = Object.keys(getComponentProps(WrappedComponent)) const props = filter(originalProps, v => v !== childPropName).concat(additionalPropNames) return Vue.component('withSubscription', { |
