Skip to content

Commit

Permalink
fix(datepicker): fix defineClasses parent props problem
Browse files Browse the repository at this point in the history
  • Loading branch information
mlmoravek committed Apr 20, 2024
1 parent b9656a6 commit 0cb6bd8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/oruga/src/composables/defineClasses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function computeClass(
suffix = "",
): string {
// get component props
const props = vm.props;
const props = getProps(vm).props; // TODO: remove `.props` when object escape get reverted

const configField = vm.proxy?.$options.configField;
if (!configField)
Expand Down Expand Up @@ -264,9 +264,10 @@ const getProps = (vm: ComponentInternalInstance): ComponentProps => {

// get all props which ends with "Props", these are compressed parent props
// append these parent props as root level prop
Object.keys(props)
props = Object.keys(props)
.filter((key) => key.endsWith("Props"))
.forEach((key) => (props = { ...props, ...props[key] }));
.map((key) => props[key])
.reduce((a, b) => ({ ...a, ...b }), props);

// TODO: revert object escape
return { props };
Expand Down

0 comments on commit 0cb6bd8

Please sign in to comment.