优化Pdf

master
LiuJiaNan 2025-12-26 14:35:12 +08:00
parent 372d36299c
commit c8a636df4e
2 changed files with 4 additions and 1 deletions

View File

@ -7,6 +7,8 @@ export interface PdfProps {
name?: string; name?: string;
/** 是否显示弹窗 */ /** 是否显示弹窗 */
visible?: boolean; visible?: boolean;
/** 弹窗的标题,默认 ”PDF预览“ */
title?: string;
/** 关闭弹窗的方法 */ /** 关闭弹窗的方法 */
onCancel?: () => void; onCancel?: () => void;
/** 是否使用内联模式true为不使用弹窗默认 false */ /** 是否使用内联模式true为不使用弹窗默认 false */

View File

@ -18,6 +18,7 @@ function Pdf(props) {
file, file,
name, name,
inline = false, inline = false,
title = "PDF预览",
style = {}, style = {},
} = props; } = props;
@ -94,7 +95,7 @@ function Pdf(props) {
open={visible} open={visible}
maskClosable={false} maskClosable={false}
width={isFullscreen ? "100vw" : pdfWidth + 100} width={isFullscreen ? "100vw" : pdfWidth + 100}
title="PDF预览" title={title}
onCancel={() => { onCancel={() => {
isFullscreen && exitFullscreen(); isFullscreen && exitFullscreen();
onCancel(); onCancel();