Skip to content

Commit 53a9f3d

Browse files
committed
修复 XModel 高度无法自适应的问题
1 parent d985ef1 commit 53a9f3d

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/components/XModal/src/XModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const props = defineProps({
99
loading: propTypes.bool.def(false),
1010
title: propTypes.string.def('弹窗'),
1111
width: propTypes.string.def('40%'),
12-
height: propTypes.string.def('60%'),
12+
height: propTypes.string,
1313
minWidth: propTypes.string.def('460'),
1414
minHeight: propTypes.string.def('320'),
1515
showFooter: propTypes.bool.def(true)

src/views/system/post/form.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<!-- 弹窗 -->
3-
<XModal :title="modelTitle" :loading="modelLoading" v-model="modelVisible" height="270px">
3+
<XModal :title="modelTitle" :loading="modelLoading" v-model="modelVisible">
44
<!-- 表单:添加/修改 -->
55
<Form
66
ref="formRef"
@@ -45,14 +45,14 @@ const formRef = ref<FormExpose>() // 表单 Ref
4545
const detailData = ref() // 详情 Ref
4646
4747
// 打开弹窗
48-
const openModal = async (type: string, rowId?: number) => {
48+
const openModal = async (type: string, id?: number) => {
4949
modelVisible.value = true
5050
modelLoading.value = true
5151
modelTitle.value = t('action.' + type)
5252
actionType.value = type
5353
// 设置数据
54-
if (rowId) {
55-
const res = await PostApi.getPostApi(rowId)
54+
if (id) {
55+
const res = await PostApi.getPostApi(id)
5656
if (type === 'update') {
5757
unref(formRef)?.setValues(res)
5858
} else if (type === 'detail') {

src/views/system/post/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const [registerTable, { reload, deleteData, exportList }] = useXTable({
6666
6767
// 表单相关的变量
6868
const modalRef = ref()
69-
const openModal = (actionType: string, id?: number) => {
70-
modalRef.value.openModal(actionType, id)
69+
const openModal = (type: string, id?: number) => {
70+
modalRef.value.openModal(type, id)
7171
}
7272
</script>

0 commit comments

Comments
 (0)