Skip to content

Commit

Permalink
fix(VMenu): min width property (#19771)
Browse files Browse the repository at this point in the history
fixes #16987

Co-authored-by: John Leider <[email protected]>
  • Loading branch information
elkofy and johnleider authored May 21, 2024
1 parent 2f8ee0f commit 7d955d2
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions packages/vuetify/src/composables/dimensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,25 @@ export const makeDimensionProps = propsFactory({
}, 'dimension')

export function useDimension (props: DimensionProps) {
const dimensionStyles = computed(() => ({
height: convertToUnit(props.height),
maxHeight: convertToUnit(props.maxHeight),
maxWidth: convertToUnit(props.maxWidth),
minHeight: convertToUnit(props.minHeight),
minWidth: convertToUnit(props.minWidth),
width: convertToUnit(props.width),
}))
const dimensionStyles = computed(() => {
const styles: Record<string, any> = {}

const height = convertToUnit(props.height)
const maxHeight = convertToUnit(props.maxHeight)
const maxWidth = convertToUnit(props.maxWidth)
const minHeight = convertToUnit(props.minHeight)
const minWidth = convertToUnit(props.minWidth)
const width = convertToUnit(props.width)

if (height != null) styles.height = height
if (maxHeight != null) styles.maxHeight = maxHeight
if (maxWidth != null) styles.maxWidth = maxWidth
if (minHeight != null) styles.minHeight = minHeight
if (minWidth != null) styles.minWidth = minWidth
if (width != null) styles.width = width

return styles
})

return { dimensionStyles }
}

0 comments on commit 7d955d2

Please sign in to comment.