form组件隐藏域新增默认值

This commit is contained in:
JaguarJack 2021-05-12 08:09:58 +08:00
parent 67363e6478
commit 2f5c62666a

View File

@ -65,6 +65,8 @@ abstract class Form
protected $primaryKeyField = 'id';
protected $primaryKeyValue = 0;
protected $fieldsValue = [];
/**
@ -125,7 +127,7 @@ abstract class Form
{
if ($this->primaryKeyField) {
return array_merge($this->fields(), [
self::hidden($this->primaryKeyField, 0)
self::hidden($this->primaryKeyField, $this->primaryKeyValue)
]);
}