fix: 修复文件重命名时不能回显原值的问题

This commit is contained in:
2024-04-29 20:31:14 +08:00
parent f99c8f1b5a
commit 3dfa97e785
3 changed files with 19 additions and 6 deletions

View File

@@ -14,11 +14,17 @@
</template>
<script lang="ts" setup>
import type { FileItem } from '@/apis'
import type { FormInstance } from '@arco-design/web-vue'
interface Props {
data: FileItem
}
const props = withDefaults(defineProps<Props>(), {})
const formRef = ref<FormInstance>()
const form = reactive({
name: ''
name: props.data?.name || ''
})
defineExpose({ formRef })

View File

@@ -12,6 +12,7 @@ export function openFileRenameModal(data: FileItem, callback?: () => void) {
width: '90%',
content: () =>
h(ModalContent, {
data,
ref: (e) => {
ModalContentRef.value = e as any
}