Skip to content

Commit 9ec5a0d

Browse files
committed
fix(VListItem): fix rounded prop
fixes #22015
1 parent 48d20f3 commit 9ec5a0d

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

packages/vuetify/src/composables/__tests__/rounded.spec.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { makeRoundedProps, useRounded } from '../rounded'
33

44
// Utilities
55
import { mount } from '@vue/test-utils'
6+
import { toRef } from 'vue'
67

78
// Types
89
import type { RoundedProps } from '../rounded'
@@ -42,4 +43,23 @@ describe('rounded.ts', () => {
4243

4344
expect(roundedClasses.value).toStrictEqual(expected)
4445
})
46+
47+
it.each([
48+
[null, []],
49+
[1, []],
50+
// Rounded only
51+
[true, ['foo--rounded']],
52+
['', ['foo--rounded']],
53+
// Rounded with 0
54+
[0, ['rounded-0']],
55+
[false, ['rounded-0']],
56+
// Rounded with a word
57+
['circle', ['rounded-circle']],
58+
// Corner and axis rounded
59+
['te-xl be-lg', ['rounded-te-xl', 'rounded-be-lg']],
60+
])('should return same result when props are passed as ref', (rounded: RoundedProps['rounded'], expected: any) => {
61+
const { roundedClasses } = useRounded(toRef(() => rounded), 'foo')
62+
63+
expect(roundedClasses.value).toStrictEqual(expected)
64+
})
4565
})

packages/vuetify/src/composables/rounded.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function useRounded (
3131
): RoundedData {
3232
const roundedClasses = computed(() => {
3333
const rounded = isRef(props) ? props.value : props.rounded
34-
const tile = isRef(props) ? props.value : props.tile
34+
const tile = isRef(props) ? false : props.tile
3535
const classes: string[] = []
3636

3737
if (tile || rounded === false) {

0 commit comments

Comments
 (0)