-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
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
ma-crud formType='grid-tailwind' 多层级dataIndex时 编辑不回显-(好了, 是我ma-form/index.vue文件 不对) #165
Comments
To address the issue of multi-level For fields like <a-input v-if="row.formType === 'input' && row.dataIndex.indexOf('.') !== -1" v-bind="row" :value="get(record, row.dataIndex)" @input="value => set(record, row.dataIndex, value)" /> This approach requires importing and using import { get, set } from 'lodash' By implementing this method, you ensure that your form elements correctly update nested properties, allowing for the editing of multi-level
|
It seems there was a misunderstanding in my previous instructions. If you're encountering issues with multi-level Vue.js, by default, does not directly support However, without direct modification capabilities or further details on how If the component does not support nested properties out of the box, you might need to flatten your data structure for editing purposes and then re-nest it before submission. This approach involves creating a flat structure where each key corresponds to a path (e.g., For a more specific solution, consider reaching out to the maintainers of
|
{
formType: 'grid-tailwind',
hide: true,
colNumber: 4,
cols: [
{
formList: [
{
title: '长(cm)',
dataIndex: 'dimension.package_length',
formType: 'input-number',
min: 0,
mode: 'button',
editDefaultValue: (record) => {
return 12
},
append: 'cm'
},
]
},{
formList: [
{
title: '宽(cm)',
dataIndex: 'dimension.package_width',
formType: 'input-number',
min: 0,
mode: 'button',
append: 'cm'
}
]
}, {
formList: [
{
title: '高(cm)',
dataIndex: 'dimension.package_height',
formType: 'input-number',
min: 0,
mode: 'button'
}
]
}, {
formList: [
{
title: '重量(g)',
dataIndex: 'weight',
formType: 'input-number',
min: 0,
mode: 'button',
}
]
}
]
}
The text was updated successfully, but these errors were encountered: