Open
Description
Version
Vben Admin V5
Describe the bug?
我需要根据cardId变化时获取cardNo,同时cardNo为隐藏字段不对外展示,此时cardNo的trigger却不再触发,
期望:show: false 时trigger也能正常触发,
虽然通过cardId的onchange方法也能处理,但是多字段同时控制一个字段时还是不方便,望修复
Reproduction
const [Form, formApi] = useVbenForm({
handleSubmit: onSubmit,
schema: [
{
component: 'Select',
componentProps: {
options: computed(() => masterCardList.value),
placeholder: '请选择',
},
fieldName: 'cardId',
label: '主卡卡号',
rules: 'required',
},
{
component: 'Input',
dependencies: {
show: false,
triggerFields: ['cardId'],
trigger(values, form) {
const cardNo = masterCardList.value.find(
(item: any) => item.value === values.cardId,
)?.label;
form.setFieldValue('cardNo', cardNo);
},
},
fieldName: 'cardNo',
label: 'cardNo',
rules: 'required',
},
],
showDefaultActions: false,
});
System Info
2025.07.09 11:00 拉取的最新代码
Relevant log output
Validations
- Read the docs
- Ensure the code is up to date. (Some issues have been fixed in the latest version)
- I have searched the existing issues and checked that my issue does not duplicate any existing issues.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.