From d0d783645fb12c4cf119383dcfd1331c2f660a74 Mon Sep 17 00:00:00 2001 From: jd-solanki Date: Wed, 2 Aug 2023 09:54:31 +0530 Subject: [PATCH] types: resolved type issues --- packages/anu-vue/src/components/list/AList.vue | 1 - packages/anu-vue/src/composables/useDefaults.ts | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/anu-vue/src/components/list/AList.vue b/packages/anu-vue/src/components/list/AList.vue index 5db9651d..fab10e54 100644 --- a/packages/anu-vue/src/components/list/AList.vue +++ b/packages/anu-vue/src/components/list/AList.vue @@ -83,7 +83,6 @@ function handleListItemClick(item: AListPropItems[number]) { > diff --git a/packages/anu-vue/src/composables/useDefaults.ts b/packages/anu-vue/src/composables/useDefaults.ts index e554535c..7d1dd67c 100644 --- a/packages/anu-vue/src/composables/useDefaults.ts +++ b/packages/anu-vue/src/composables/useDefaults.ts @@ -1,10 +1,10 @@ import { objectKeys, objectPick } from '@antfu/utils' -import type { PluginOptions } from 'anu-vue/plugin' -import type { PluginOptionDefaults } from 'anu-vue/pluginDefaults' -import { ANU_PROPS_DEFAULTS } from 'anu-vue/symbols' import { deepmergeCustom } from 'deepmerge-ts' import type { Ref, StyleValue } from 'vue' import { toValue } from 'vue' +import type { PluginOptions } from 'anu-vue/plugin' +import type { PluginOptionDefaults } from 'anu-vue/pluginDefaults' +import { ANU_PROPS_DEFAULTS } from 'anu-vue/symbols' export const mergePropsDefaults = deepmergeCustom({ mergeArrays: false, @@ -35,7 +35,7 @@ export function useDefaults>(definitionPro provide(ANU_PROPS_DEFAULTS, newPropsDefaults) // Return Values - const propsRef = ref() as Ref['props']> + let propsReactive = reactive({}) as ReturnType['props'] const defaultsClass = ref() as ReturnType['defaultsClass'] const defaultsStyle = ref() as ReturnType['defaultsStyle'] const defaultsAttrs = ref() as ReturnType['defaultsAttrs'] @@ -74,7 +74,7 @@ export function useDefaults>(definitionPro const explicitPropsNames = objectKeys(vm?.vnode.props || {}) as unknown as (keyof Props)[] const explicitProps = objectPick(definitionProps, explicitPropsNames) - propsRef.value = mergePropsDefaults(definitionProps, componentProps, explicitProps) as Props + propsReactive = mergePropsDefaults(definitionProps, componentProps, explicitProps) as Props } watch( @@ -90,7 +90,7 @@ export function useDefaults>(definitionPro ) return { - props: toReactive(propsRef), + props: propsReactive, defaultsClass, defaultsStyle, defaultsAttrs,