This commit is contained in:
SunCheng
2026-02-15 10:10:28 +08:00
parent e51a3edd50
commit a88556c784
92 changed files with 6751 additions and 776 deletions

View File

@@ -1,20 +1,30 @@
<template>
<van-dialog
<template>
<PopupContainer
v-model:show="show"
title="新增交易分类"
show-cancel-button
show-confirm-button
confirm-text="确认"
cancel-text="取消"
@confirm="handleConfirm"
@cancel="resetAddForm"
>
<van-field
v-model="classifyName"
placeholder="请输入新的交易分类"
/>
</van-dialog>
<van-form ref="addFormRef">
<van-field
v-model="classifyName"
name="name"
label="分类名称"
placeholder="请输入分类名称"
:rules="[{ required: true, message: '请输入分类名称' }]"
/>
</van-form>
</PopupContainer>
</template>
<script setup>
import { ref } from 'vue'
import { showToast } from 'vant'
import PopupContainer from './PopupContainer.vue'
const emit = defineEmits(['confirm'])
@@ -39,6 +49,11 @@ const handleConfirm = () => {
classifyName.value = ''
}
// 重置表单
const resetAddForm = () => {
classifyName.value = ''
}
// 暴露方法给父组件
defineExpose({
open