React Avatar Editor 没有获取上传按钮
React Avatar Editor not getting upload button
我正在尝试使用 react-avatar-editor (https://www.npmjs.com/package/react-avatar-editor) 我已经安装并导入了组件,但是我没有得到上传按钮
这是我使用头像编辑器时的简单组件
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import Nav from "./Nav";
import AvatarEditor from 'react-avatar-editor'
export default class EditProfile extends Component {
render () {
return (
<div>
<Nav logoUrl="logo_white.svg" color="#D41F36"/>
hello there
<AvatarEditor
image="/imgs/A066.jpg"
width={250}
height={250}
border={50}
color={[255, 255, 255, 0.6]} // RGBA
scale={1.5}
rotate={0}
/>
</div>
)
}
}
I should have this screen
but I had this
请帮忙解决这个问题?
react-avatar-editor 不处理图像选择。它专门处理给定图像的图像裁剪、调整大小和旋转。所以你需要编写一些代码来获取图像并传递给 react-avatar-editor 组件。
您可以在此处查看操作方法https://github.com/mosch/react-avatar-editor/blob/master/docs/App.jsx
我正在尝试使用 react-avatar-editor (https://www.npmjs.com/package/react-avatar-editor) 我已经安装并导入了组件,但是我没有得到上传按钮
这是我使用头像编辑器时的简单组件
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import Nav from "./Nav";
import AvatarEditor from 'react-avatar-editor'
export default class EditProfile extends Component {
render () {
return (
<div>
<Nav logoUrl="logo_white.svg" color="#D41F36"/>
hello there
<AvatarEditor
image="/imgs/A066.jpg"
width={250}
height={250}
border={50}
color={[255, 255, 255, 0.6]} // RGBA
scale={1.5}
rotate={0}
/>
</div>
)
}
}
I should have this screen but I had this
请帮忙解决这个问题?
react-avatar-editor 不处理图像选择。它专门处理给定图像的图像裁剪、调整大小和旋转。所以你需要编写一些代码来获取图像并传递给 react-avatar-editor 组件。
您可以在此处查看操作方法https://github.com/mosch/react-avatar-editor/blob/master/docs/App.jsx