You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.3 KiB

1 year ago
<template>
<div>
<vxe-modal
1 year ago
:width="defaultModalSize.width"
:height="defaultModalSize.height"
1 year ago
show-zoom
1 year ago
resize
transfer
esc-closable
1 year ago
:fullscreen="$store.getters.device === 'mobile'"
:z-index="zIndex"
v-model="showModal"
:footer-hide="true"
title="预览"
11 months ago
:padding="false"
1 year ago
>
<template>
<iframe
11 months ago
style="display: block;width: 100%;height: 100%;border: 0;"
1 year ago
:src="codeUri"
frameborder="0"
></iframe>
</template>
</vxe-modal>
</div>
</template>
<script>
import { PopupManager } from "element-ui/lib/utils/popup";
1 year ago
import {defaultModalSize} from "@/settings";
1 year ago
export default {
data() {
return {
1 year ago
defaultModalSize,
1 year ago
zIndex: PopupManager.nextZIndex(),
showModal:false,
codeUri: "",
}
},
methods: {
open(url) {
1 year ago
this.codeUri = `${window.location.origin}/admin/#/preview?url=${url}`;
1 year ago
this.showModal = true;
}
},
computed: {},
11 months ago
watch: {
showModal(newVal) {
if (!newVal) {
this.codeUri = ''
} else {
this.zIndex = PopupManager.nextZIndex()
}
}
},
1 year ago
created() {
this.$bus.$on('online-file',(url) => this.open(url))
},
beforeDestroy() {
this.$bus.$off('online-file')
}
}
</script>
<style scoped lang="scss">
</style>