diff --git a/components/vc-menu/Divider.jsx b/components/vc-menu/Divider.jsx index a4c04832b..45b6f457a 100644 --- a/components/vc-menu/Divider.jsx +++ b/components/vc-menu/Divider.jsx @@ -1,3 +1,5 @@ +import { inject } from 'vue'; +import { injectExtraPropsKey } from './FunctionProvider'; export default { name: 'MenuDivider', inheritAttrs: false, @@ -8,9 +10,14 @@ export default { }, rootPrefixCls: String, }, + setup() { + return { + injectExtraProps: inject(injectExtraPropsKey, () => ({})), + }; + }, render() { - const { rootPrefixCls } = this.$props; + const { rootPrefixCls } = {...this.$props, ...this.injectExtraProps}; const { class: className = '', style } = this.$attrs; - return
  • ; + return
  • ; }, };