perf: 优化iframe预览,不区分大小写;预览背景不透明
This commit is contained in:
parent
d76a3b2c77
commit
8aab4d1038
@ -4358,13 +4358,16 @@ export default {
|
||||
return this.notPreviewDialogVisible;
|
||||
},
|
||||
hasIframePreview(suffix, fileHandlers) {
|
||||
// 将 suffix 转换为小写
|
||||
const lowerCaseSuffix = suffix.toLowerCase();
|
||||
for (let key in fileHandlers) {
|
||||
const extensions = key.split(',')
|
||||
if (extensions.includes(suffix)) {
|
||||
return fileHandlers[key]
|
||||
// 将 key 中的扩展名全部转换为小写
|
||||
const extensions = key.split(',').map(extension => extension.toLowerCase());
|
||||
if (extensions.includes(lowerCaseSuffix)) {
|
||||
return fileHandlers[key];
|
||||
}
|
||||
}
|
||||
return null
|
||||
return null;
|
||||
},
|
||||
determineDownload(file) {
|
||||
this.download(file)
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button size="medium" type="primary" @click="openUrl"><svg-icon icon-class="wailian"/></el-button>
|
||||
<el-button title="外部打开" size="medium" type="primary" @click="openUrl"><svg-icon icon-class="wailian"/></el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -153,6 +153,7 @@ export default {
|
||||
-webkit-box-pack: center;
|
||||
-ms-flex-pack: center;
|
||||
justify-content: center;
|
||||
background: #dcdfe6;
|
||||
iframe {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user