修复 XModel 高度无法自适应的问题

pull/1/head
YunaiV 2023-02-11 16:32:10 +08:00
parent d985ef194e
commit 53a9f3dabf
3 changed files with 7 additions and 7 deletions

View File

@ -9,7 +9,7 @@ const props = defineProps({
loading: propTypes.bool.def(false),
title: propTypes.string.def('弹窗'),
width: propTypes.string.def('40%'),
height: propTypes.string.def('60%'),
height: propTypes.string,
minWidth: propTypes.string.def('460'),
minHeight: propTypes.string.def('320'),
showFooter: propTypes.bool.def(true)

View File

@ -1,6 +1,6 @@
<template>
<!-- 弹窗 -->
<XModal :title="modelTitle" :loading="modelLoading" v-model="modelVisible" height="270px">
<XModal :title="modelTitle" :loading="modelLoading" v-model="modelVisible">
<!-- 表单添加/修改 -->
<Form
ref="formRef"
@ -45,14 +45,14 @@ const formRef = ref<FormExpose>() // 表单 Ref
const detailData = ref() // Ref
//
const openModal = async (type: string, rowId?: number) => {
const openModal = async (type: string, id?: number) => {
modelVisible.value = true
modelLoading.value = true
modelTitle.value = t('action.' + type)
actionType.value = type
//
if (rowId) {
const res = await PostApi.getPostApi(rowId)
if (id) {
const res = await PostApi.getPostApi(id)
if (type === 'update') {
unref(formRef)?.setValues(res)
} else if (type === 'detail') {

View File

@ -66,7 +66,7 @@ const [registerTable, { reload, deleteData, exportList }] = useXTable({
//
const modalRef = ref()
const openModal = (actionType: string, id?: number) => {
modalRef.value.openModal(actionType, id)
const openModal = (type: string, id?: number) => {
modalRef.value.openModal(type, id)
}
</script>