4
4
SystemStyleObject ,
5
5
HTMLChakraProps ,
6
6
} from '@chakra-ui/vue-system'
7
- import { defineComponent , h , PropType } from '@vue/runtime-core'
7
+ import { computed , defineComponent , h , PropType } from '@vue/runtime-core'
8
8
9
9
export interface BoxProps extends HTMLChakraProps < 'div' > { }
10
10
@@ -61,17 +61,19 @@ export const CSquare = defineComponent({
61
61
} ,
62
62
} ,
63
63
setup ( props , { slots, attrs } ) {
64
- const styles : SystemStyleObject = props . centerContent
65
- ? { display : 'flex' , alignItems : 'center' , justifyContent : 'center' }
66
- : { }
64
+ const styles = computed < SystemStyleObject > ( ( ) =>
65
+ props . centerContent
66
+ ? { display : 'flex' , alignItems : 'center' , justifyContent : 'center' }
67
+ : { }
68
+ )
67
69
return ( ) => {
68
70
return h (
69
71
CBox ,
70
72
{
71
73
label : 'square' ,
72
74
boxSize : props . size ,
73
75
__css : {
74
- ...styles ,
76
+ ...styles . value ,
75
77
flexShrink : 0 ,
76
78
flexGrow : 0 ,
77
79
} ,
@@ -84,21 +86,13 @@ export const CSquare = defineComponent({
84
86
} )
85
87
86
88
export const CCircle = defineComponent ( {
87
- props : {
88
- size : [ Object , String , Number ] as PropType < SquareProps [ 'size' ] > ,
89
- centerContent : {
90
- type : [ Boolean ] as PropType < SquareProps [ 'centerContent' ] > ,
91
- default : true ,
92
- } ,
93
- } ,
94
- setup ( props , { slots, attrs } ) {
89
+ setup ( _ , { slots, attrs } ) {
95
90
return ( ) => {
96
91
return h (
97
92
CSquare ,
98
93
{
99
94
label : 'circle' ,
100
95
borderRadius : '9999px' ,
101
- size : props . size ,
102
96
...attrs ,
103
97
} ,
104
98
slots
0 commit comments