From 61d853e6a52d1881eca4ba10a9f06fe4937108e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A0=E6=9C=A8?= Date: Fri, 13 Aug 2021 11:13:29 +0800 Subject: [PATCH] style(types): fix some type statement --- src/components/Application/src/AppLogo.vue | 2 +- src/components/Cropper/src/CopperModal.vue | 4 +++- .../default/header/components/notify/NoticeList.vue | 8 +++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/Application/src/AppLogo.vue b/src/components/Application/src/AppLogo.vue index 93d433777..359688cbe 100644 --- a/src/components/Application/src/AppLogo.vue +++ b/src/components/Application/src/AppLogo.vue @@ -23,7 +23,7 @@ /** * The theme of the current parent component */ - theme: { type: String, validator: (v) => ['light', 'dark'].includes(v) }, + theme: { type: String, validator: (v: string) => ['light', 'dark'].includes(v) }, /** * Whether to show title */ diff --git a/src/components/Cropper/src/CopperModal.vue b/src/components/Cropper/src/CopperModal.vue index d16e45888..61b932082 100644 --- a/src/components/Cropper/src/CopperModal.vue +++ b/src/components/Cropper/src/CopperModal.vue @@ -122,10 +122,12 @@ import { isFunction } from '/@/utils/is'; import { useI18n } from '/@/hooks/web/useI18n'; + type apiFunParams = { file: Blob; name: string; filename: string }; + const props = { circled: { type: Boolean, default: true }, uploadApi: { - type: Function as PropType<({ file: Blob, name: string, filename: string }) => Promise>, + type: Function as PropType<(params: apiFunParams) => Promise>, }, }; diff --git a/src/layouts/default/header/components/notify/NoticeList.vue b/src/layouts/default/header/components/notify/NoticeList.vue index 441010eea..aab8f1ef1 100644 --- a/src/layouts/default/header/components/notify/NoticeList.vue +++ b/src/layouts/default/header/components/notify/NoticeList.vue @@ -11,7 +11,9 @@ :style="{ cursor: isTitleClickable ? 'pointer' : '' }" :delete="!!item.titleDelete" :ellipsis=" - $props.titleRows > 0 ? { rows: $props.titleRows, tooltip: item.title } : false + $props.titleRows && $props.titleRows > 0 + ? { rows: $props.titleRows, tooltip: !!item.title } + : false " :content="item.title" /> @@ -34,8 +36,8 @@