mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-01 11:38:36 +08:00
fix: menu mode error from vue3.0.3 #3354
This commit is contained in:
parent
2bb27a4210
commit
c7816b319e
@ -1,4 +1,4 @@
|
||||
import { createVNode, defineComponent, inject, provide } from 'vue';
|
||||
import { createVNode, defineComponent, inject, provide, watch } from 'vue';
|
||||
import { injectExtraPropsKey } from './FunctionProvider';
|
||||
|
||||
export default function wrapWithConnect(WrappedComponent) {
|
||||
@ -13,9 +13,13 @@ export default function wrapWithConnect(WrappedComponent) {
|
||||
props,
|
||||
setup(props) {
|
||||
provide(injectExtraPropsKey, undefined); // 断掉 injectExtraPropsKey 的依赖
|
||||
const injectExtraProps = injectExtraPropsKey ? inject(injectExtraPropsKey, () => ({})) : {};
|
||||
watch(injectExtraProps, ()=>{
|
||||
// 神奇的问题,vue 3.0.3 之后,没能正确响应式,暂时加个 watch hack 一下
|
||||
});
|
||||
return {
|
||||
props,
|
||||
injectExtraProps: injectExtraPropsKey ? inject(injectExtraPropsKey, () => ({})) : {},
|
||||
injectExtraProps,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
Loading…
Reference in New Issue
Block a user