mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-16 09:58:13 +08:00
✨ 点击外部可配置是否退出
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<TOverlay v-model="visible" :to-click="onCancel" :blur-val="'3px'" hide>
|
<TOverlay v-model="visible" :to-click="onOuter" :blur-val="'3px'" hide>
|
||||||
<div class="confirm-div">
|
<div class="confirm-div">
|
||||||
<div class="confirm-box">
|
<div class="confirm-box">
|
||||||
<div class="confirm-title">
|
<div class="confirm-title">
|
||||||
@@ -44,6 +44,7 @@ interface TOConfirmProps {
|
|||||||
title: string;
|
title: string;
|
||||||
subtitle?: string;
|
subtitle?: string;
|
||||||
isInput?: boolean;
|
isInput?: boolean;
|
||||||
|
otcancel?: boolean;
|
||||||
cancel?: string;
|
cancel?: string;
|
||||||
confirm?: string;
|
confirm?: string;
|
||||||
/** 此值为 true 时显示对话框 */
|
/** 此值为 true 时显示对话框 */
|
||||||
@@ -63,6 +64,7 @@ const props = withDefaults(defineProps<TOConfirmProps>(), {
|
|||||||
modelValue: false,
|
modelValue: false,
|
||||||
title: "确认",
|
title: "确认",
|
||||||
subtitle: "",
|
subtitle: "",
|
||||||
|
otcancel: true,
|
||||||
isInput: false,
|
isInput: false,
|
||||||
cancel: "取消",
|
cancel: "取消",
|
||||||
confirm: "确定",
|
confirm: "确定",
|
||||||
@@ -82,6 +84,10 @@ const inputVal = computed({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function onOuter(): void {
|
||||||
|
props.otcancel && onCancel();
|
||||||
|
}
|
||||||
|
|
||||||
function onCancel(): void {
|
function onCancel(): void {
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
emits("cancel");
|
emits("cancel");
|
||||||
|
|||||||
Reference in New Issue
Block a user