Skip to content

Commit

Permalink
types: resolved type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-solanki committed Aug 2, 2023
1 parent fac2b8b commit d0d7836
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion packages/anu-vue/src/components/list/AList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ function handleListItemClick(item: AListPropItems[number]) {
>
<slot
:name="updatedSlotName"
:index="index"
v-bind="slotProps"
/>
</template>
Expand Down
12 changes: 6 additions & 6 deletions packages/anu-vue/src/composables/useDefaults.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -35,7 +35,7 @@ export function useDefaults<Props extends Record<string, unknown>>(definitionPro
provide(ANU_PROPS_DEFAULTS, newPropsDefaults)

// Return Values
const propsRef = ref() as Ref<ReturnType<Props>['props']>
let propsReactive = reactive({}) as ReturnType<Props>['props']
const defaultsClass = ref() as ReturnType<Props>['defaultsClass']
const defaultsStyle = ref() as ReturnType<Props>['defaultsStyle']
const defaultsAttrs = ref() as ReturnType<Props>['defaultsAttrs']
Expand Down Expand Up @@ -74,7 +74,7 @@ export function useDefaults<Props extends Record<string, unknown>>(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(
Expand All @@ -90,7 +90,7 @@ export function useDefaults<Props extends Record<string, unknown>>(definitionPro
)

return {
props: toReactive(propsRef),
props: propsReactive,
defaultsClass,
defaultsStyle,
defaultsAttrs,
Expand Down

0 comments on commit d0d7836

Please sign in to comment.