mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-12-26 17:55:58 +08:00
optimize(manage): replace Object.assign with jsonClone for safer data handling in model initialization
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { jsonClone } from '@sa/utils';
|
||||
import { enableStatusOptions, userGenderOptions } from '@/constants/business';
|
||||
import { fetchGetAllRoles } from '@/service/api';
|
||||
import { useFormRules, useNaiveForm } from '@/hooks/common/form';
|
||||
@@ -93,7 +94,7 @@ function handleInitModel() {
|
||||
model.value = createDefaultModel();
|
||||
|
||||
if (props.operateType === 'edit' && props.rowData) {
|
||||
Object.assign(model.value, props.rowData);
|
||||
Object.assign(model.value, jsonClone(props.rowData));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user