@@ -32,28 +32,37 @@ interface Props {
3232
3333const props = defineProps <Props >();
3434
35- const style = computed (() => ({
36- ' --pc-columns-xs' : formatColumns (props .columns ?.xs || 6 ),
37- ' --pc-columns-sm' : formatColumns (props .columns ?.sm ),
38- ' --pc-columns-md' : formatColumns (props .columns ?.md ),
39- ' --pc-columns-lg' : formatColumns (props .columns ?.lg ),
40- ' --pc-columns-xl' : formatColumns (props .columns ?.xl ),
41- ' --pc-columns-space-xs' : props .spacing ?.xs
42- ? ` var(--p-space-${props .spacing ?.xs }) `
43- : undefined ,
44- ' --pc-columns-space-sm' : props .spacing ?.sm
45- ? ` var(--p-space-${props .spacing ?.sm }) `
46- : undefined ,
47- ' --pc-columns-space-md' : props .spacing ?.md
48- ? ` var(--p-space-${props .spacing ?.md }) `
49- : undefined ,
50- ' --pc-columns-space-lg' : props .spacing ?.lg
51- ? ` var(--p-space-${props .spacing ?.lg }) `
52- : undefined ,
53- ' --pc-columns-space-xl' : props .spacing ?.xl
54- ? ` var(--p-space-${props .spacing ?.xl }) `
55- : undefined ,
56- } as Record <string , any >));
35+ const style = computed (() => {
36+ const fullStyles = {
37+ ' --pc-columns-xs' : formatColumns (props .columns ?.xs || 6 ),
38+ ' --pc-columns-sm' : formatColumns (props .columns ?.sm ),
39+ ' --pc-columns-md' : formatColumns (props .columns ?.md ),
40+ ' --pc-columns-lg' : formatColumns (props .columns ?.lg ),
41+ ' --pc-columns-xl' : formatColumns (props .columns ?.xl ),
42+ ' --pc-columns-space-xs' : props .spacing ?.xs
43+ ? ` var(--p-space-${props .spacing ?.xs }) `
44+ : undefined ,
45+ ' --pc-columns-space-sm' : props .spacing ?.sm
46+ ? ` var(--p-space-${props .spacing ?.sm }) `
47+ : undefined ,
48+ ' --pc-columns-space-md' : props .spacing ?.md
49+ ? ` var(--p-space-${props .spacing ?.md }) `
50+ : undefined ,
51+ ' --pc-columns-space-lg' : props .spacing ?.lg
52+ ? ` var(--p-space-${props .spacing ?.lg }) `
53+ : undefined ,
54+ ' --pc-columns-space-xl' : props .spacing ?.xl
55+ ? ` var(--p-space-${props .spacing ?.xl }) `
56+ : undefined ,
57+ } as Record <string , any >;
58+
59+ return Object .keys (fullStyles ).reduce ((acc , key ) => {
60+ if (fullStyles [key ] !== undefined ) {
61+ acc [key ] = fullStyles [key ];
62+ }
63+ return acc ;
64+ }, {});
65+ });
5766
5867function formatColumns(columns ? : number | string ) {
5968 if (! columns ) {
0 commit comments