百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

react-cropper

> 前端框架
开源

Cropperjs 作为 React 组件

2.1K stars0 点赞2 次浏览
访问官网GitHub

工具介绍

Cropperjs 作为 React 组件

React-cropper

Cropperjs 作为 React 组件

演示

文档

  • Cropperjs

安装

通过 npm 安装

bash
npm install --save react-cropper

你的项目中需要 cropper.css,它来自 cropperjs。 由于此项目依赖 cropperjs,所以在 npm 版本 3.0.0 及之后,它位于 /node_modules/React-cropper/node_modules/cropperjs/dist/cropper.css 或 node_modules/cropperjs/dist/cropper.css

简单示例

…

选项

src

  • 类型: string
  • 默认值: null
javascript
<Cropper src="http://fengyuanchen.github.io/cropper/images/picture.jpg" />

alt

  • 类型: string
  • 默认值: picture

crossOrigin

  • 类型: string
  • 默认值: null

dragMode

https://github.com/fengyuanchen/cropperjs#dragmode

scaleX

https://github.com/fengyuanchen/cropperjs#scalexscalex

scaleY

https://github.com/fengyuanchen/cropperjs#scalexscaley

启用

https://github.com/fengyuanchen/cropperjs#enable

禁用

https://github.com/fengyuanchen/cropperjs#disable

zoomTo

https://github.com/fengyuanchen/cropperjs#zoomto

rotateTo

https://github.com/fengyuanchen/cropperjs#rotateto

其他选项

将 docs 中的所有选项作为属性进行接受。

方法

使用 onInitialized 中的 cropper 实例来访问 cropperjs 方法

构建

bash
npm run build

开发

bash
npm start

作者

维护人

许可证

麻省理工学院

Click for a Demo Fong Kuanghuei Shubhendu Shekhar

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptcropcrop-imagecroppercropperjs

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架