mirror of
https://github.com/HoshinoSuzumi/rayine-ui.git
synced 2025-04-23 01:18:50 +08:00
♻️ Rename useUI
This commit is contained in:
parent
ce36a35873
commit
c2e97c1d17
src/runtime
@ -1,9 +1,10 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { twJoin, twMerge } from 'tailwind-merge'
|
import { twJoin, twMerge } from 'tailwind-merge'
|
||||||
import type { PropType } from 'vue'
|
import { computed, toRef, type PropType } from 'vue'
|
||||||
import { button } from '../../ui.config'
|
import { button } from '../../ui.config'
|
||||||
import type { DeepPartial, Strategy } from '../../types/utils'
|
import type { DeepPartial, Strategy } from '../../types/utils'
|
||||||
import type { ButtonColor, ButtonSize, ButtonVariant } from '../../types/button'
|
import type { ButtonColor, ButtonSize, ButtonVariant } from '../../types/button'
|
||||||
|
import { useRayUI } from '#build/imports'
|
||||||
|
|
||||||
const config = button
|
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(() => {
|
const buttonClass = computed(() => {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import { inject, ref, onMounted } from 'vue';
|
||||||
import type { MessageProviderApi, Message } from '../../types/message'
|
import type { MessageProviderApi, Message } from '../../types/message'
|
||||||
|
|
||||||
const providerApi = inject<MessageProviderApi>('ray-message-provider')
|
const providerApi = inject<MessageProviderApi>('ray-message-provider')
|
||||||
|
@ -4,7 +4,7 @@ import { mergeUiConfig } from '../utils'
|
|||||||
import { omit, getValueByPath } from '../utils/objectUtils'
|
import { omit, getValueByPath } from '../utils/objectUtils'
|
||||||
import { useAppConfig } from '#app'
|
import { useAppConfig } from '#app'
|
||||||
|
|
||||||
export const useUI = <T>(
|
export const useRayUI = <T>(
|
||||||
key: string,
|
key: string,
|
||||||
ui?: Ref<(DeepPartial<T> & { strategy?: Strategy }) | undefined>,
|
ui?: Ref<(DeepPartial<T> & { strategy?: Strategy }) | undefined>,
|
||||||
config?: T | Ref<T>,
|
config?: T | Ref<T>,
|
Loading…
Reference in New Issue
Block a user