We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
列配置:
{ title: '品类范围', field: props.editable ? 'sortRange' : 'sortRangeName', width: 160, editRender: { enabled: props.editable }, slots: props.editable ? { edit: ({ row, rowIndex }) => { return ( <FormField commonComponentProps={{}} component="Cascader" componentProps={{ ref: 'sortRangeRef', placeholder: '请选择', options: sortList.value, filterable: true, showAllLevels: false, popperClass: 'vxe-table--ignore-clear', props: { value: 'categoryId', label: 'categoryName', children: 'children', checkStrictly: true, }, onChange(value: any) { const findCategoryName = ( id: string, list: any[], ): string => { for (const item of list) { if (item.categoryId === id) { return item.categoryName; } if (item.children) { const found = findCategoryName(id, item.children); if (found) return found; } } return ''; }; // 获取数组的最后一个值作为实际选中值 const selectedId = Array.isArray(value) ? value[value.length - 1] : value; row.sortRangeName = findCategoryName( selectedId, sortList.value, ); }, }} fieldName={`${props.prefixName}[${rowIndex}].sortRange`} hideLabel={true} inline={true} /> ); }, default: ({ row }) => { return row.sortRangeName; }, } : undefined, },
表格配置:
editRules: { xxxx: [{ required: true, message: '必须填写' }] }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
列配置:
表格配置:
The text was updated successfully, but these errors were encountered: