3 changed files with 60 additions and 3 deletions
@ -0,0 +1,27 @@ |
|||
<template> |
|||
<div class="min-w-[420px] max-w-[540px] text-primary bg-white rounded-lg"> |
|||
<h1 class="my-8 text-lg font-medium text-center px-8">{{ props.title }}</h1> |
|||
<div class="text-lg px-4 text-center"> |
|||
{{ props.desc }} |
|||
</div> |
|||
<footer class="flex justify-center items-center gap-6 py-10"> |
|||
<button class="btn-dark px-8 py-2 text-lg min-w-[120px]" @click="$emit('onOk')">{{ okText || "确定" }}</button> |
|||
<button v-if="props.type === 'confirm'" class="btn-light px-8 py-2 text-lg min-w-[120px]" @click="$emit('onCancel')"> |
|||
{{ cancelText || "取消" }} |
|||
</button> |
|||
</footer> |
|||
</div> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
const props = defineProps<{ |
|||
title: string; |
|||
desc: string; |
|||
type: "alert" | "confirm"; // alert 一个按钮,confirm:两个按钮 |
|||
okText: string; |
|||
cancelText: string; |
|||
}>(); |
|||
const emit = defineEmits<{ |
|||
(e: "onCancel"): void; |
|||
(e: "onOk"): void; |
|||
}>(); |
|||
</script> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue