Skip to main content

CoverUploader

Function CoverUploader 

Source
fn CoverUploader(_: CoverUploaderProps) -> Element
Expand description

封面上传子组件。

封装封面图的全部状态与交互:拖拽/粘贴/选择文件上传、URL 输入、预览、移除。 通过两个 signal 与父组件双向绑定:

  • cover_image:子组件写入最终 URL,父组件读取用于保存;
  • cover_uploading:子组件上传时置 true,父组件在 on_submit 读取以拦截 上传中的保存(避免封面 URL 尚未落定就提交导致封面丢失)。 其余上传中间态(error/url/drag)对本组件私有。

write_editor 抽取以降低 god component 复杂度(见 dioxus-render-purity skill)。

§Props

For details, see the props struct definition.