diff --git a/components/_util/store/connect.jsx b/components/_util/store/connect.jsx index 05601589d..0bce77360 100644 --- a/components/_util/store/connect.jsx +++ b/components/_util/store/connect.jsx @@ -26,6 +26,7 @@ export default function connect (mapStateToProps) { }, data () { this.store = this.storeContext.store + this.preProps = { ...omit(getOptionProps(this), ['__propsSymbol__']) } return { subscribed: finnalMapStateToProps(this.store.getState(), this.$props), } @@ -49,10 +50,10 @@ export default function connect (mapStateToProps) { if (!this.unsubscribe) { return } - - const nextState = finnalMapStateToProps(this.store.getState(), this.$props) - if (!shallowEqual(this.subscribed, nextState)) { - this.subscribed = nextState + const props = getOptionProps(this) + const nextSubscribed = finnalMapStateToProps(this.store.getState(), props) + if (!shallowEqual(this.preProps, props) || !shallowEqual(this.subscribed, nextSubscribed)) { + this.subscribed = nextSubscribed } }, @@ -74,8 +75,10 @@ export default function connect (mapStateToProps) { }, }, render () { + this.preProps = { ...this.$props } const { $listeners, $slots = {}, $attrs, $scopedSlots, subscribed, store } = this const props = getOptionProps(this) + this.preProps = { ...omit(props, ['__propsSymbol__']) } const wrapProps = { props: { ...props, diff --git a/components/menu/demo/index.vue b/components/menu/demo/index.vue index 5dbdae551..d99434b8f 100644 --- a/components/menu/demo/index.vue +++ b/components/menu/demo/index.vue @@ -1,6 +1,7 @@