🐛 definedProps无法引入外部Typescript类型定义

This commit is contained in:
BTMuli
2023-10-13 23:19:05 +08:00
parent 7dedcc4ea9
commit d2fa3529f8
2 changed files with 18 additions and 3 deletions

View File

@@ -36,7 +36,14 @@
<script lang="ts" setup>
import { onMounted, reactive, ref, watch } from "vue";
const props = withDefaults(defineProps<TGApp.Component.Confirm.Params>(), {
interface ConfirmProps {
title: string;
text?: string;
mode?: "confirm" | "input";
otcancel?: boolean;
}
const props = withDefaults(defineProps<ConfirmProps>(), {
title: "",
text: "",
mode: "confirm",

View File

@@ -10,7 +10,13 @@
<script lang="ts" setup>
import { ref, reactive, onMounted } from "vue";
const props = withDefaults(defineProps<TGApp.Component.Snackbar.Params>(), {
interface SnackbarProps {
text: string;
color?: string;
timeout?: number;
}
const props = withDefaults(defineProps<SnackbarProps>(), {
text: "",
color: "success",
timeout: 1500,
@@ -41,6 +47,8 @@ function transColor(color: string): string {
return "#faad14";
case "info":
return "#1890ff";
case "cancel":
return "#ABB2BF";
default:
return color;
}
@@ -95,7 +103,7 @@ defineExpose({
transform: translateX(-50%);
}
.func-snackbar .func-snackbar-text {
.func-snackbar-text {
color: #fff;
font-size: 16px;
font-weight: 500;