试图找出图像的作物纵横比属性,但不能使其工作。代码isL
protected function addUserFields()
{
$this->crud->addFields([
[
'name' => 'profile_image', // The db column name
'label' => trans('Profile image'), // Table column heading
'type' => 'image',
'upload' => true,
'crop' => true,
'aspect-ratio' => 1,
]);
}发布于 2021-05-10 03:39:50
这可能是因为你用的是破折号而不是下划线。它应该是:
'aspect_ratio‘=> 1,//省略或设置为0以允许任何高宽比
还请注意医生们说的话:
aspect_ratio的值是一个浮点,表示裁剪矩形高度和宽度的比率。举个例子,
当然,对于更极端的矩形,你可以使用任何值。
https://stackoverflow.com/questions/67461367
复制相似问题