Commit f28e3b28 by Sweet Zhang

修改更新数据的时候第一次默认数据不显示

parent 769a2101
......@@ -122,7 +122,7 @@
<script setup name="Payables">
import CommonPage from '@/components/commonPage'
import { ref, reactive } from 'vue'
import { ref, reactive,nextTick } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { formatCurrency } from '@/utils/number'
import { expectedFortuneList, payRecordList, addPayRecord, updatePayRecord, exportPayRecord, payableReport } from '@/api/financial/commission'
......@@ -480,12 +480,13 @@ const handleSelect = async (e, row) => {
} else if (e === 'updateData') {
editStatus.value = 'edit'
addPayRecordDialogVisible.value = true
if (addPayRecordFormRef.value) {
addPayRecordFormModel.value = {
...selectedRow.value
}
}
// 2. 使用 nextTick 等待 DOM 更新
nextTick(() => {
// 3. 此时 addRecordRef.value 一定存在了
if (addPayRecordFormRef.value && selectedRow.value) {
addPayRecordFormModel.value = { ...selectedRow.value };
}
});
console.log(addPayRecordFormModel.value)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment