使用 Checkbox 组件查询库存数量为 0 的数据
export const searchFormSchema: FormSchema[] = [ { label: '库存数量', field: 'Quantity', component: 'Checkbox', defaultValue: null, componentProps: { checkedValue: 0, // 复选框选中时的值 uncheckedValue: null, // 复选框未选中时的值 }, renderComponentContent: '库存为0', emitPrefix: 'search', } ];
// 在组件中添加监听事件,监听checkbox的变化 watch( () => searchForm.quantity, (value) => { if (value) { // 当checkbox选中时,查询数据库里库存数量为0的数据 fetchData(); } } );
原文地址: https://www.cveoy.top/t/topic/qr7w 著作权归作者所有。请勿转载和采集!