componentValue($value); $this->defaultSrc = config('config.default_avatar'); } static public function make($value = null) { return new Avatar($value); } /** * 设置头像的图标类型,参考 Icon 组件 * @param string $icon * @return $this */ public function triggerIconStyle(string $icon) { $this->triggerIconStyle = $icon; return $this; } /** * 设置头像的大小 number * @param int|string $size * @return $this */ public function size($size) { $this->size = $size; return $this; } /*** * 是否自动根据头像尺寸调整字体大小 * @param bool|boolean $fix * @return $this */ public function autoFixFontSize(bool $fix) { $this->autoFixFontSize = $fix; return $this; } /** * 设置头像的形状 circle / square * @param string $shape * @return $this */ public function shape(string $shape) { $this->shape = $shape; return $this; } /** * 图片头像的资源地址 * @param string $src * @return $this */ public function imageUrl(string $src) { $this->imageUrl = $src; return $this; } /** * 设置默认头像 * @param string $defaultSrc * @return $this */ public function defaultSrc($defaultSrc) { $this->defaultSrc = $defaultSrc; return $this; } }