♻️ Rename useUI

This commit is contained in:
Timothy Yin 2024-11-18 15:25:30 +08:00
parent ce36a35873
commit c2e97c1d17
3 changed files with 5 additions and 3 deletions

View File

@ -1,9 +1,10 @@
<script lang="ts" setup>
import { twJoin, twMerge } from 'tailwind-merge'
import type { PropType } from 'vue'
import { computed, toRef, type PropType } from 'vue'
import { button } from '../../ui.config'
import type { DeepPartial, Strategy } from '../../types/utils'
import type { ButtonColor, ButtonSize, ButtonVariant } from '../../types/button'
import { useRayUI } from '#build/imports'
const config = button
@ -42,7 +43,7 @@ const props = defineProps({
},
})
const { ui, attrs } = useUI('button', toRef(props, 'ui'), config)
const { ui, attrs } = useRayUI('button', toRef(props, 'ui'), config)
const buttonClass = computed(() => {
// @ts-ignore

View File

@ -1,4 +1,5 @@
<script lang="ts" setup>
import { inject, ref, onMounted } from 'vue';
import type { MessageProviderApi, Message } from '../../types/message'
const providerApi = inject<MessageProviderApi>('ray-message-provider')

View File

@ -4,7 +4,7 @@ import { mergeUiConfig } from '../utils'
import { omit, getValueByPath } from '../utils/objectUtils'
import { useAppConfig } from '#app'
export const useUI = <T>(
export const useRayUI = <T>(
key: string,
ui?: Ref<(DeepPartial<T> & { strategy?: Strategy }) | undefined>,
config?: T | Ref<T>,