This repository was archived by the owner on Sep 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
_templates/generator/component
playground/src/.generated Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -3,15 +3,16 @@ to: packages/<%=h.changeCase.paramCase(name)%>/src/index.ts
3
3
---
4
4
5
5
import { h, defineComponent, PropType } from 'vue'
6
+ import { chakra, DOMElements } from '@chakra-ui/vue-system'
6
7
7
- export const <%= h . changeCase . pascalCase (name) %> = defineComponent({
8
+ export const CIcon = defineComponent({
8
9
props: {
9
10
as: {
10
- type: Object as PropType<string >,
11
+ type: [ Object, String] as PropType<DOMElements >,
11
12
default: 'div',
12
13
},
13
14
},
14
15
setup(props, { slots, attrs }) {
15
- return h( props? .as, { ...attrs }, slots.default?.() )
16
+ return () => h(chakra( props.as) , { ...attrs }, slots)
16
17
},
17
18
})
Original file line number Diff line number Diff line change 1
1
import { h , defineComponent , PropType } from 'vue'
2
+ import { chakra , DOMElements } from '@chakra-ui/vue-system'
2
3
3
4
export const CIcon = defineComponent ( {
4
5
props : {
5
6
as : {
6
- type : Object as PropType < string > ,
7
+ type : [ Object , String ] as PropType < DOMElements > ,
7
8
default : 'div' ,
8
9
} ,
9
10
} ,
10
11
setup ( props , { slots, attrs } ) {
11
- return h ( props ? .as , { ...attrs } , slots . default ?. ( ) )
12
+ return ( ) => h ( chakra ( props . as ) , { ...attrs } , slots )
12
13
} ,
13
14
} )
Original file line number Diff line number Diff line change 3
3
'@chakra-ui/c-accordion' : '/Users/jonathanbakebwa/Github/chakra-ui-vue-next/packages/c-accordion/src/index.ts' ,
4
4
'@chakra-ui/c-alert' : '/Users/jonathanbakebwa/Github/chakra-ui-vue-next/packages/c-alert/src/index.ts' ,
5
5
'@chakra-ui/c-button' : '/Users/jonathanbakebwa/Github/chakra-ui-vue-next/packages/c-button/src/index.ts' ,
6
+ '@chakra-ui/c-icon' : '/Users/jonathanbakebwa/Github/chakra-ui-vue-next/packages/c-icon/src/index.ts' ,
6
7
'@chakra-ui/c-theme-provider' : '/Users/jonathanbakebwa/Github/chakra-ui-vue-next/packages/c-theme-provider/src/index.ts' ,
7
8
'@chakra-ui/system' : '/Users/jonathanbakebwa/Github/chakra-ui-vue-next/packages/system/src/index.ts' ,
8
9
'@chakra-ui/test-utils' : '/Users/jonathanbakebwa/Github/chakra-ui-vue-next/packages/test-utils/src/index.ts' ,
You can’t perform that action at this time.
0 commit comments