vanthink-ued / react-core-image-upload Goto Github PK
View Code? Open in Web Editor NEWa component for image to upload and crop
Home Page: http://vanthink-ued.github.io/react-core-image-upload/index.html
License: MIT License
a component for image to upload and crop
Home Page: http://vanthink-ued.github.io/react-core-image-upload/index.html
License: MIT License
提示报错:
addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's render
method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).
使用最简单的引用
<ReactCoreImageUpload
text="Upload Your Image"
className='pure-button'
inputOfFile="files"
url="..."
imageUploaded={(res) => {
debugger;
}}>
Warning: Component t declared PropTypes
instead of propTypes
. Did you misspell the property assignment?
如何配置图片旋转呢,有的时候上传图片,是水平摆放的,希望能旋转90°
Hi I want to try this package, but upon compiling using webpack i got this error:
ERROR in ./~/css-loader!./~/babel-loader/lib?{"presets":["react","es2015","stage-1"]}!./~/style-loader!./~/css-loader!./~/react-core-image-upload/src/style.css
Module build failed: Unknown word (1:1)
> 1 | 'use strict';
| ^
2 |
3 | // style-loader: Adds some css to the DOM by adding a <style> tag
4 |
@ ./~/style-loader!./~/css-loader!./~/react-core-image-upload/src/style.css 4:14-207
I install using yarn
Component t declared PropTypes
instead of propTypes
. Did you misspell the property assignment?
Invalid prop compress
of type string
supplied to t
, expected number
.
I download the demo and run it.
Changing cropRatio to "1:4" and it does not work, and can not see cropped image
如题
<ReactCoreImageUpload
text="上传"
className="upload"
inputOfFile="files"
url="..."
crop={true}
maxWidth={150}
maxheight={150}
cropBtn={{ ok: '保存', 'cancel': '取消' }}
imageUploaded={this.imageUploaded}
imageChange={this.imageChange}
imageuploading={this.imageuploading}
>
三个事件 imageChanged 这个事件不起作用,请问可以修复吗
import ReactCoreImageUpload from 'react-core-image-upload/react-core-image-upload';
启动就报:
Failed to compile
./~/react-core-image-upload/react-core-image-upload.js
Module not found: E:\HBWorkspace\web\node_modules\React\react.js
does not match the corresponding path on disk react
.
Failed to compile.
Error in ./~/react-core-image-upload/react-core-image-upload.js
Module not found: [CaseSensitivePathsPlugin] E:\work\fangke\smartofficeportal.visitor.web\node_modules\React\react.js
does not match the corresponding path on disk react
.
@ ./~/react-core-image-upload/react-core-image-upload.js 1:85-101
感觉好像还是个半成品... 只能先换其他的用了。有待完善
Hi,
I've tried to install the npm module in 2 different environments and both times I get the error:
Failed to compile.
Error in ./~/react-core-image-upload/src/react-core-image-upload.js
Module parse failed: /media/notconfusing/9d9b45fc-55f7-428c-a228-1c4c4a1b728c/home/notconfusing/workspace/module-3-group-project-jungle/client/node_modules/react-core-image-upload/src/react-core-image-upload.js Unexpected token (39:6)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (39:6)
@ ./src/Upload.js 18:28-62
It seems that react is trying to load it as pure js and gets hungup on the jsx parts. Normally I don't have to specify the loader for files like this so I wonder why its happening on this project.
当e.target.files[0].size < this.props.maxFileSize
时: options is not defined
react-core-image-upload/src/react-core-image-upload.js 第125行
Hi @JackPu! I was trying out the demo and it seems like once the image is cropped, and clicked on 'Save', the cropped image does not show up. Not sure if that is supposed to work that way?
Also, given that you have a circular avatar image in the demo, does the library also allow for circular cropping?
Thank you for open sourcing this library!
保存之后报错 但是network接口返回成功了 imageUploaded事件里面res undefined 这是咋回事
Just simple import this lib
import ReactCoreImageUpload from 'react-core-image-upload';
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.