Commit 31f3a291 by 胡悦

修复pdf显示标题bug

1 parent a381978b
......@@ -763,7 +763,6 @@ const PDFViewerApplication = {
title = url;
}
}
this.setTitle(title);
},
......@@ -771,8 +770,9 @@ const PDFViewerApplication = {
if (this.isViewerEmbedded) {
return;
}
document.title = title;
const urlParams = new URLSearchParams(new URL(document.URL).search);
const _title = urlParams.get('title') || title;
document.title = _title;
},
async close() {
......@@ -2069,7 +2069,6 @@ let webViewerFileInputChange, webViewerOpenFile;
if (URL.createObjectURL && !_app_options.AppOptions.get("disableCreateObjectURL")) {
let url = URL.createObjectURL(file);
if (file.name) {
url = {
url,
......
......@@ -7,7 +7,7 @@
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<web-view :src="url"></web-view>
<web-view ref="webview" :src="url"></web-view>
</template>
<script type="text/ecmascript-6">
......@@ -25,9 +25,9 @@ export default {
console.log(options,'options')
if(options.fileUrl) this.url = `${this.viewerUrl}?file=${options.fileUrl}`
else this.url = options.url
if (options.title) uni.setNavigationBarTitle({
title: options.title
})
if (options.title) {
this.url = `${this.url}&title=${options.title}`
}
},
mounted () {
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!