提交、取消、关闭按钮在 React google picker 中不起作用,但可以通过双击文件来选择文件
import GooglePicker from "react-google-picker";
<GooglePicker
clientId={"**********"}
developerKey={"*********"}
scope={["https://www.googleapis.com/auth/drive.file"]}
onChange={(data) => googleDriveFilePicked(data)}
onAuthenticate={(token) => { setToken(token) }}
onAuthFailed={(data) => console.log("on auth failed:", data)}
multiselect={false}
navHidden={false}
authImmediate={false}
mimeTypes={["application/pdf", "application/vnd.google-apps.folder"]}
viewId={"DOCS"}
>
<Button className="drive-logo-section" <img alt="Google" src={Google} />
</Button>
</GooglePicker>
git链接:https://github.com/sdoomz/react-google-picker/issues/38
我写的一篇博客文章介绍了如何将 Google Picker 添加到 React:https://medium.com/@mohammedshameemke/google-picker-api-integration-to-reactjs-mui-typescript-6c7461aa4598