🔥 删除无用代码

This commit is contained in:
BTMuli
2023-07-15 18:39:52 +08:00
parent 12c71a176f
commit f083886a98

View File

@@ -37,11 +37,9 @@
<script lang="ts" setup> <script lang="ts" setup>
// vue // vue
import { computed, inject } from "vue"; import { computed } from "vue";
import TOverlay from "../main/t-overlay.vue"; import TOverlay from "../main/t-overlay.vue";
const test = inject("hide");
interface TOConfirmProps { interface TOConfirmProps {
title: string; title: string;
subtitle?: string; subtitle?: string;
@@ -72,26 +70,30 @@ const props = withDefaults(defineProps<TOConfirmProps>(), {
const visible = computed({ const visible = computed({
get: () => props.modelValue, get: () => props.modelValue,
set: (v) => emits("update:modelValue", v), set: (v) => {
emits("update:modelValue", v);
},
}); });
const inputVal = computed({ const inputVal = computed({
get: () => props.modelInput, get: () => props.modelInput,
set: (v) => emits("update:modelInput", v), set: (v) => {
emits("update:modelInput", v);
},
}); });
const onCancel = () => { function onCancel(): void {
visible.value = false; visible.value = false;
emits("cancel"); emits("cancel");
}; }
const onConfirm = () => { function onConfirm(): void {
visible.value = false; visible.value = false;
emits("confirm"); emits("confirm");
if (props.isInput) { if (props.isInput) {
inputVal.value = ""; inputVal.value = "";
} }
}; }
</script> </script>
<style scoped> <style scoped>