修复 XModel 高度无法自适应的问题
parent
d985ef194e
commit
53a9f3dabf
|
@ -9,7 +9,7 @@ const props = defineProps({
|
||||||
loading: propTypes.bool.def(false),
|
loading: propTypes.bool.def(false),
|
||||||
title: propTypes.string.def('弹窗'),
|
title: propTypes.string.def('弹窗'),
|
||||||
width: propTypes.string.def('40%'),
|
width: propTypes.string.def('40%'),
|
||||||
height: propTypes.string.def('60%'),
|
height: propTypes.string,
|
||||||
minWidth: propTypes.string.def('460'),
|
minWidth: propTypes.string.def('460'),
|
||||||
minHeight: propTypes.string.def('320'),
|
minHeight: propTypes.string.def('320'),
|
||||||
showFooter: propTypes.bool.def(true)
|
showFooter: propTypes.bool.def(true)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<!-- 弹窗 -->
|
<!-- 弹窗 -->
|
||||||
<XModal :title="modelTitle" :loading="modelLoading" v-model="modelVisible" height="270px">
|
<XModal :title="modelTitle" :loading="modelLoading" v-model="modelVisible">
|
||||||
<!-- 表单:添加/修改 -->
|
<!-- 表单:添加/修改 -->
|
||||||
<Form
|
<Form
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
|
@ -45,14 +45,14 @@ const formRef = ref<FormExpose>() // 表单 Ref
|
||||||
const detailData = ref() // 详情 Ref
|
const detailData = ref() // 详情 Ref
|
||||||
|
|
||||||
// 打开弹窗
|
// 打开弹窗
|
||||||
const openModal = async (type: string, rowId?: number) => {
|
const openModal = async (type: string, id?: number) => {
|
||||||
modelVisible.value = true
|
modelVisible.value = true
|
||||||
modelLoading.value = true
|
modelLoading.value = true
|
||||||
modelTitle.value = t('action.' + type)
|
modelTitle.value = t('action.' + type)
|
||||||
actionType.value = type
|
actionType.value = type
|
||||||
// 设置数据
|
// 设置数据
|
||||||
if (rowId) {
|
if (id) {
|
||||||
const res = await PostApi.getPostApi(rowId)
|
const res = await PostApi.getPostApi(id)
|
||||||
if (type === 'update') {
|
if (type === 'update') {
|
||||||
unref(formRef)?.setValues(res)
|
unref(formRef)?.setValues(res)
|
||||||
} else if (type === 'detail') {
|
} else if (type === 'detail') {
|
||||||
|
|
|
@ -66,7 +66,7 @@ const [registerTable, { reload, deleteData, exportList }] = useXTable({
|
||||||
|
|
||||||
// 表单相关的变量
|
// 表单相关的变量
|
||||||
const modalRef = ref()
|
const modalRef = ref()
|
||||||
const openModal = (actionType: string, id?: number) => {
|
const openModal = (type: string, id?: number) => {
|
||||||
modalRef.value.openModal(actionType, id)
|
modalRef.value.openModal(type, id)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue