fix: ts问题修复

This commit is contained in:
yangmi 2022-07-22 15:20:33 +08:00
parent 7dcb06fec8
commit 9a42915244
3 changed files with 7 additions and 7 deletions

View File

@ -3,9 +3,10 @@
"version": "1.0.6",
"scripts": {
"dev": "vite --host",
"build": "vite build",
"build": "npm run test && vite build",
"preview": "vite preview",
"new": "plop --plopfile ./plop/plopfile.js",
"test": "vue-tsc --noEmit",
"postinstall": "husky install"
},
"dependencies": {

View File

@ -7,7 +7,7 @@
:title="item.title"
:name="key">
<template #header-extra>
<n-icon size="24" @click.stop="onAddEvent(item, key)">
<n-icon size="24" @click.stop="onAddEvent(item, key as unknown as EventType)">
<component :is="AddCircleIcon"></component>
</n-icon>
</template>
@ -103,7 +103,7 @@ const { targetData, chartEditStore } = useTargetData();
//
const eventConfig = computed<EventConfig>(() => {
return targetData.value?.eventConfig
return targetData.value?.eventConfig as EventConfig
})
// ,

View File

@ -5,7 +5,7 @@
:themeSetting="themeSetting"
:themeColor="themeColor"
:style="{...getSizeStyle(item.attr)}"
v-on="useEvent ? getEventList(item.eventConfig) : {}"
v-on="useEvent ? getEventList(item.eventConfig as EventConfig) : {}"
></component>
</template>
@ -14,8 +14,7 @@ import { PropType, toRefs, getCurrentInstance, ComponentInternalInstance } from
import { useEventBus } from '@/hooks'
import { convertEventBusListeners } from '@/hooks/useEventBus.hook'
import { getSizeStyle } from '../../utils'
import omit from 'lodash/omit'
import { EventTriggerType, EventType } from '@/enums/eventEnum'
import { EventTriggerType } from '@/enums/eventEnum'
import { CreateComponentType, EventConfig } from '@/packages/index.d'
import { newFunctionHandle } from '@/utils'
@ -77,7 +76,7 @@ const getEventList = (eventConfig: EventConfig) => {
const listeners = {
on: {
forceUpdate: () => {
instance.ctx.$forceUpdate()
instance.proxy?.$forceUpdate()
}
}
}