javascript - filepond-plugin-image-size-metadata 配置
问题描述
我希望你一切都好,只是想知道是否有人成功设置了 filepond 图像大小元数据插件。
https://github.com/yoldar/filepond-plugin-image-size-metadata
文档有些欠缺,目前我已将 allowImageSizeMetadata 设置为 FilePond 组件的参数:
<FilePond
name={file}
files={file}
allowMultiple={false}
allowImageSizeMetadata={true}
server={null}
instantUpload={false}
onupdatefiles={(fileItems) => onFileChange(fileItems)}
/>
我已在文件顶部导入,如下所示:
import { FilePond, registerPlugin } from 'react-filepond';
import 'filepond/dist/filepond.min.css';
import FilePondPluginImageSizeMetaData from 'filepond-plugin-image-size-metadata';
import FilePondPluginImageExifOrientation from 'filepond-plugin-image-exif-orientation';
import FilePondPluginImagePreview from 'filepond-plugin-image-preview';
import 'filepond-plugin-image-preview/dist/filepond-plugin-image-preview.css';
但是当我在控制台中注销输出时,我没有看到任何额外的东西,我认为我应该像宽度和高度元数据一样。
谁能看到我可能遗漏的东西?
谢谢
解决方案
我认为您需要注册它。
例如,请参阅图像预览插件文档中的代码片段。
import * as FilePond from 'filepond';
import FilePondPluginImagePreview from 'filepond-plugin-image-preview';
import 'filepond-plugin-image-preview/dist/filepond-plugin-image-preview.css';
// Register the plugin <- this call
FilePond.registerPlugin(FilePondPluginImagePreview);
推荐阅读
- c++ - Traversing Template Parameter Packs, what is the role of the specialization which takes no argument?
- python - 在所有测试语料库中测试模型 doc2vec
- excel - 获取调用宏的按钮的工作表
- c# - 当 TreeList 绑定到 DataSource 时 setValue() 不起作用
- python - 在python中使用箭头递增日期不改变属性
- assembly - 什么是 ihah、ohah 和 int86?
- php - Laravel sortBy() 基于字符串值
- python - 整数转换的舍入是否有不好的副作用?
- android - React Native Android 模块与 Andorid Studio 和 React native builder 冲突
- php - Yii2-usuario:扩展登录过程