npm run jest --updateSnapshot To run the linter make lint Extending the file viewer Adding supported file types is easy (and pull requests are welcome!). Say, for example, you want to add support for.rtffiles. First, you need to create a "driver" for that file type. A driver is ju...
npm install react-file-viewer@0.5.0。 有一个主要的React组件FileViewer,它具有以下道具: fileType字符串:要显示的资源类型(一种受支持的文件格式,例如'png')。传递不支持的文件类型将导致显示unsupported file type消息(或自定义组件)。 filePath 字符串:FileViewer显示的资源的URL(后台给返的二进制流也可以)。
npm install react-file-viewer@0.5.0。 有一个主要的React组件FileViewer,它具有以下道具: fileType字符串:要显示的资源类型(一种受支持的文件格式,例如'png')。传递不支持的文件类型将导致显示unsupported file type消息(或自定义组件)。 filePath 字符串:FileViewer显示的资源的URL(后台给返的二进制流也可以)。
React-file-viewer可以用npm i react-file-viewer命令安装,下面的例子显示了React-file-viewer的一个简单例子:// MyApp.js import React, { Component } from 'react'; import logger from 'logging-library'; import FileViewer from 'react-file-viewer'; import { CustomErrorComponent } from 'custom-error...
react-file-viewer react-doc-viewer npm_ssh •1.0.2•2 years ago•0dependents•MITpublished version1.0.2,2 years ago0dependentslicensed under $MIT 25 andyliu007 •1.0.5•a year ago•0dependents•MITpublished version1.0.5,a year ago0dependentslicensed under $MIT ...
你可以使用npm i @phuocng/react-pdf-viewer命令来安装它,下面的例子展示了React-pdf-viewer的基本用法。 // Core viewerimport{Viewer}from'@react-pdf-viewer/core';// Pluginsimport{defaultLayoutPlugin}from'@react-pdf-viewer/default-layout';// Import stylesimport'@react-pdf-viewer/core/lib/styles/ind...
npm install react-file-viewer@0.5.0. There is one main React component, FileViewer, that takes the following props: fileType string: type of resource to be shown (one of the supported file formats, eg 'png'). Passing in an unsupported file type will result in displaying an unsupported ...
npm install react-file-viewer // 或 yarn add react-file-viewer ``` 2.2 导入react-file-viewer组件 在开发页面中需要使用文件预览功能的组件中,引入react-file-viewer组件: ```javascript import FileViewer from 'react-file-viewer'; ``` 2.3 使用react-file-viewer进行文件预览 在需要进行文件预览的位置...
npm run lint Extending the file viewer Adding supported file types is easy (and pull requests are welcome!). Say, for example, you want to add support for.rtffiles. First, you need to create a "driver" for that file type. A driver is just a component that is capable of rendering tha...
react实现pdf文档可翻页查看,可放大缩小及全屏等功能,选的是react-pdf插件,react-file-viewer插件也试了下,可以查看pdf,不过是一次性加载全部,最终选了前者 插件引用 Ant Design Pro+react-pdf插件 插件地址: https://www.npmjs.com/package/react-pdf ...