feat(form): type配置为函数时,参数中的model等对象设置层readonly

This commit is contained in:
roymondchen 2026-01-07 14:43:14 +08:00
parent 5267381ebf
commit df611571c7

View File

@ -16,6 +16,7 @@
* limitations under the License.
*/
import { readonly } from 'vue';
import dayjs from 'dayjs';
import utc from 'dayjs/plugin/utc';
import { cloneDeep } from 'lodash-es';
@ -209,10 +210,10 @@ export const filterFunction = <T = any>(
) => {
if (typeof config === 'function') {
return (config as FilterFunction<T>)(mForm, {
values: mForm?.initValues || {},
model: props.model,
parent: mForm?.parentValues || {},
formValue: mForm?.values || props.model,
values: readonly(mForm?.initValues || {}),
model: readonly(props.model),
parent: readonly(mForm?.parentValues || {}),
formValue: readonly(mForm?.values || props.model),
prop: props.prop,
config: props.config,
index: props.index,