Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(VMenu): min width property #19771

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }
}
Loading