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", "version": "1.0.6",
"scripts": { "scripts": {
"dev": "vite --host", "dev": "vite --host",
"build": "vite build", "build": "npm run test && vite build",
"preview": "vite preview", "preview": "vite preview",
"new": "plop --plopfile ./plop/plopfile.js", "new": "plop --plopfile ./plop/plopfile.js",
"test": "vue-tsc --noEmit",
"postinstall": "husky install" "postinstall": "husky install"
}, },
"dependencies": { "dependencies": {

View File

@ -7,7 +7,7 @@
:title="item.title" :title="item.title"
:name="key"> :name="key">
<template #header-extra> <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> <component :is="AddCircleIcon"></component>
</n-icon> </n-icon>
</template> </template>
@ -103,7 +103,7 @@ const { targetData, chartEditStore } = useTargetData();
// //
const eventConfig = computed<EventConfig>(() => { const eventConfig = computed<EventConfig>(() => {
return targetData.value?.eventConfig return targetData.value?.eventConfig as EventConfig
}) })
// , // ,

View File

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