type: 修改编译错误的type类型

This commit is contained in:
MTrun 2022-02-28 11:00:33 +08:00
parent 3fe2fbfc08
commit c29a70f90b
6 changed files with 10 additions and 10 deletions

2
.env
View File

@ -1,5 +1,5 @@
# port # port
VITE_DEV_PORT = 8001 VITE_DEV_PORT = '8001'
# development path # development path
VITE_DEV_PATH = / VITE_DEV_PATH = /

View File

@ -113,7 +113,7 @@ const clearHideOption = (options: MenuOptionsItemType[], hideList?: MenuEnum[])
} }
// * 右键处理 // * 右键处理
const handleContextMenu = (e: MouseEvent, item: CreateComponentType) => { const handleContextMenu = (e: MouseEvent, item?: CreateComponentType) => {
e.stopPropagation() e.stopPropagation()
e.preventDefault() e.preventDefault()
let target = e.target let target = e.target

View File

@ -82,11 +82,11 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref } from 'vue' import { reactive, ref, PropType } from 'vue'
import { renderIcon, renderLang, requireUrl, requireFallbackImg } from '@/utils' import { renderIcon, renderLang, requireUrl, requireFallbackImg } from '@/utils'
import { icon } from '@/plugins' import { icon } from '@/plugins'
import { MacOsControlBtn } from '@/components/MacOsControlBtn' import { MacOsControlBtn } from '@/components/MacOsControlBtn'
import { Chartype } from '../../index.d'
const { const {
EllipsisHorizontalCircleSharpIcon, EllipsisHorizontalCircleSharpIcon,
CopyIcon, CopyIcon,
@ -103,7 +103,7 @@ const t = window['$t']
const props = defineProps({ const props = defineProps({
// todo ITEN type // todo ITEN type
cardData: Object cardData: Object as PropType<Chartype>
}) })
const fnBtnList = reactive([ const fnBtnList = reactive([
{ {

View File

@ -4,7 +4,7 @@ import { DialogEnum } from '@/enums/pluginEnum'
// 数据初始化 // 数据初始化
export const useDataListInit = () => { export const useDataListInit = () => {
const list = ref<object[]>([ const list = ref<{id: number, title:string, release: boolean}[]>([
{ {
id: 1, id: 1,
title: '物料1', title: '物料1',

View File

@ -4,7 +4,7 @@ import { fetchPathByName, routerTurnByPath } from '@/utils'
export const useModalDataInit = () => { export const useModalDataInit = () => {
const modalShow = ref<boolean>(false) const modalShow = ref<boolean>(false)
// TODO 补充 modalData 类型格式 // TODO 补充 modalData 类型格式
const modalData = ref<object | unknown>(null) const modalData = ref<object | null>(null)
// 关闭 modal // 关闭 modal
const closeModal = () => { const closeModal = () => {
@ -13,13 +13,13 @@ export const useModalDataInit = () => {
} }
// 打开 modal // 打开 modal
const resizeHandle = (cardData: Ref<object | unknown>) => { const resizeHandle = (cardData: Ref<object | null>) => {
modalShow.value = true modalShow.value = true
modalData.value = cardData modalData.value = cardData
} }
// 打开 modal // 打开 modal
const editHandle = (cardData: Ref<object | unknown>) => { const editHandle = (cardData: Ref<object | null>) => {
const path = fetchPathByName(ChartEnum.CHART_HOME_NAME, 'href') const path = fetchPathByName(ChartEnum.CHART_HOME_NAME, 'href')
routerTurnByPath(path, [(<any>cardData).id], undefined, true) routerTurnByPath(path, [(<any>cardData).id], undefined, true)
} }

View File

@ -18,7 +18,7 @@
:disabled="item.disabled" :disabled="item.disabled"
v-for="item in typeList" v-for="item in typeList"
:key="item.key" :key="item.key"
@click="btnHandle(item.index)" @click="btnHandle"
> >
<component :is="item.title"> </component> <component :is="item.title"> </component>
<template #icon> <template #icon>