Skip to content

Commit

Permalink
fix:修复可视化 CRUD 富文本字段默认值为 null 时表单打不开的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
build-admin committed Dec 25, 2023
1 parent 5075fd1 commit 7e934bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/admin/controller/crud/Crud.php
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ private function getFormField($field, $columnDict): array
$this->indexVueData['defaultItems'][$field['name']] = $field['default'];
}
if ($field['default'] == 'null') {
$this->indexVueData['defaultItems'][$field['name']] = null;
$this->indexVueData['defaultItems'][$field['name']] = $field['designType'] == 'editor' ? '' : null;
} elseif ($field['default'] == '0' && in_array($field['designType'], ['radio', 'checkbox', 'select', 'selects'])) {
// 防止为`0`时无法设置上默认值
$this->indexVueData['defaultItems'][$field['name']] = '0';
Expand Down

0 comments on commit 7e934bc

Please sign in to comment.