react-core-image-upload 一款轻量级图片上传裁剪插件
发布时间:2020-12-15 07:31:06 所属栏目:百科 来源:网络整理
导读:在不久前,我们把vue-core-image-upload 发布了2.0 。这次我们保持了完整的api迁移到了react上。支持了header 定义,支持了 file change 的自定义事件,更新了更加详细的文档。 react-core-image-upload 项目地址 Demo 快速开始 使用 npm npm install react-
在不久前,我们把vue-core-image-upload 发布了2.0 。这次我们保持了完整的api迁移到了react上。支持了header 定义,支持了 file change 的自定义事件,更新了更加详细的文档。 react-core-image-upload 项目地址 Demo 快速开始使用 npm npm install react-core-image-upload --save 使用 yarn yarn add react-core-image-upload 使用ES6 进行开发import React from 'react'; import ReactCoreImageUpload from 'react-core-image-upload'; let App = React.createClass({ //... render() { return( <div> <ReactCoreImageUpload text="Upload Your Image" class={['pure-button','pure-button-primary','js-btn-crop']} inputOfFile="files" url="./api/upload.php" imageUploaded={this.handleRes}> </ReactCoreImageUpload> </div> ); },handleRes(res) { this.setState({ // handle response }) } }) 运行DEMOnpm run start http://localhost:9000/demo/index.html Demo Online 配置属性
image uploading callback
Demo Demo 代码 发给服务端的裁剪参数
你使用裁剪的话,会向服务端发送上面的参数如上图。 如果你需要自定义裁剪弹窗的的样式,你可以自己写css进行覆盖 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- c# – 在表达式树中组合表达式
- Swift学习,常量与变量(二)
- c – 从std :: cin读取二进制数据
- ruby-on-rails – 为什么Rails 5使用ApplicationRecord而不
- react-navigation重复点击多次跳转的解决方案
- I/O并发模式:Reactor模式与Proactor模式 总价
- XML file line #2: Error inflating class android.support
- 页面用ajax实现简单的连接数据库
- plsql – 如何使用存储过程将oracle表数据转换为单独的xml文
- ruby-on-rails – 在rails初始化程序运行之前,在“块”之前