Textarea
简介
文本框允许你使用多行字符串:
use Filament\Forms\Components\Textarea;
Textarea::make('description')

调整文本框大小
通过定义 rows() 和 cols() 方法你可用修改文本框的大小:
use Filament\Forms\Components\Textarea;
Textarea::make('description')
->rows(10)
->cols(20)

除了静态值,rows() 和 cols() 方法同时也接受通过函数动态设置它们的值。你可以将各种 utility 作为参数注入到函数中。
Learn more about utility injection.| Utility | Type | Parameter | Description |
|---|---|---|---|
| Field | Filament\Forms\Components\Field | $component | The current field component instance. |
| Get function | Filament\Schemas\Components\Utilities\Get | $get | A function for retrieving values from the current form data. Validation is not run. |
| Livewire | Livewire\Component | $livewire | The Livewire component instance. |
| Eloquent model FQN | ?string<Illuminate\Database\Eloquent\Model> | $model | The Eloquent model FQN for the current schema. |
| Operation | string | $operation | The current operation being performed by the schema. Usually <code>create</code>, <code>edit</code>, or <code>view</code>. |
| Raw state | mixed | $rawState | The current value of the field, before state casts were applied. Validation is not run. |
| Eloquent record | ?Illuminate\Database\Eloquent\Model | $record | The Eloquent record for the current schema. |
| State | mixed | $state | The current value of the field. Validation is not run. |

