@tmagic/form 1.2.0-beta.11 → 1.2.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.2.0-beta.
|
|
2
|
+
"version": "1.2.0-beta.12",
|
|
3
3
|
"name": "@tmagic/form",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"dist/*",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@element-plus/icons-vue": "^2.0.9",
|
|
38
|
-
"@tmagic/design": "1.2.0-beta.
|
|
39
|
-
"@tmagic/utils": "1.2.0-beta.
|
|
38
|
+
"@tmagic/design": "1.2.0-beta.12",
|
|
39
|
+
"@tmagic/utils": "1.2.0-beta.12",
|
|
40
40
|
"lodash-es": "^4.17.21",
|
|
41
41
|
"sortablejs": "^1.14.0",
|
|
42
42
|
"vue": "^3.2.37"
|
package/src/containers/Table.vue
CHANGED
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
labelWidth="0"
|
|
102
102
|
:prop="getProp(scope.$index)"
|
|
103
103
|
:rules="column.rules"
|
|
104
|
-
:config="makeConfig(column)"
|
|
104
|
+
:config="makeConfig(column, scope.row)"
|
|
105
105
|
:model="scope.row"
|
|
106
106
|
:size="size"
|
|
107
107
|
@change="$emit('change', model[modelName])"
|
|
@@ -432,8 +432,11 @@ const toggleRowSelection = (row: any, selected: boolean) => {
|
|
|
432
432
|
tMagicTable.value?.toggleRowSelection.call(tMagicTable.value, row, selected);
|
|
433
433
|
};
|
|
434
434
|
|
|
435
|
-
const makeConfig = (config: ColumnConfig) => {
|
|
435
|
+
const makeConfig = (config: ColumnConfig, row: any) => {
|
|
436
436
|
const newConfig = cloneDeep(config);
|
|
437
|
+
if (typeof config.itemsFunction === 'function') {
|
|
438
|
+
newConfig.items = config.itemsFunction(row);
|
|
439
|
+
}
|
|
437
440
|
delete newConfig.display;
|
|
438
441
|
return newConfig;
|
|
439
442
|
};
|