jsx
import React, { Component } from 'react';
import { Document, Page } from 'react-pdf/dist/entry.webpack';
import 'react-pdf/dist/Page/AnnotationLayer.css';
import envconfig from "@/envconfig/envconfig"
import './PDFView.less';
import { getSearchQueryString } from '@/util/regexUtil'
const options = {
cMapUrl: 'cmaps/',
cMapPacked: true,
};
export default class PDFView extends Component {
state = {
file: '',
numPages: null,
}
componentDidMount(){
const href = window.location.href
const index = href.lastIndexOf("?")
const search = href.slice(index)
const name = getSearchQueryString(decodeURIComponent(search), "name")
this.setState({file:`文件路径`)
document.title = name.split("/")[name.split("/").length-1]
}
onFileChange = (event) => {
this.setState({
file: event.t