refactor: rename function

This commit is contained in:
zernonia 2023-08-23 21:17:05 +08:00
parent 68fc41db1c
commit 8088e10c57
2 changed files with 4 additions and 4 deletions

View File

@ -13,15 +13,15 @@ import {
} from 'radix-vue' } from 'radix-vue'
import { Check, ChevronDown } from 'lucide-vue-next' import { Check, ChevronDown } from 'lucide-vue-next'
import type { ParseEmits } from '@/utils' import type { ParseEmits } from '@/utils'
import { cn, convertToVNode, useEmitAsProps } from '@/utils' import { cn, convertToComponent, useEmitAsProps } from '@/utils'
export const Select = SelectRoot export const Select = SelectRoot
export const SelectGroup = SelectGroupPrimitive export const SelectGroup = SelectGroupPrimitive
export const SelectValue = SelectValuePrimitive export const SelectValue = SelectValuePrimitive
// Convert Functional component to valid VNode to be use in JSX // Convert Functional component to valid VNode to be use in JSX
const IChevrondown = convertToVNode(ChevronDown) const IChevrondown = convertToComponent(ChevronDown)
const ICheck = convertToVNode(Check) const ICheck = convertToComponent(Check)
export const SelectTrigger = defineComponent<SelectTriggerProps>( export const SelectTrigger = defineComponent<SelectTriggerProps>(
(props, { attrs, slots }) => { (props, { attrs, slots }) => {

View File

@ -33,7 +33,7 @@ export function useEmitAsProps<Name extends string>(
return result return result
} }
export function convertToVNode(component: FunctionalComponent) { export function convertToComponent(component: FunctionalComponent) {
return defineComponent({ return defineComponent({
setup() { return () => h(component) }, setup() { return () => h(component) },
}) })