fix: menu divider class not correct

pull/3150/head
tanjinzhou 2020-11-10 15:41:41 +08:00
parent 7cd86b5a00
commit 72a86910be
1 changed files with 9 additions and 2 deletions

View File

@ -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 <li class={`${className} ${rootPrefixCls}-item-divider`} style={style} />;
return <li class={[className, `${rootPrefixCls}-item-divider`]} style={style} />;
},
};