Files
RuoYi-Vue/ruoyi-ui/src/components/iFrame/index.vue

37 lines
735 B
Vue
Raw Normal View History

2021-06-17 20:17:42 +08:00
<template>
<div v-loading="loading" :style="'height:' + height">
<iframe
:src="src"
frameborder="no"
style="width: 100%; height: 100%"
scrolling="auto"
/>
</div>
</template>
<script>
export default {
props: {
src: {
type: String,
required: true
},
},
data() {
return {
height: document.documentElement.clientHeight - 94.5 + "px;",
loading: true,
url: this.src
2025-04-27 10:05:51 +08:00
}
2021-06-17 20:17:42 +08:00
},
mounted: function () {
setTimeout(() => {
2025-04-27 10:05:51 +08:00
this.loading = false
}, 300)
const that = this
2021-06-17 20:17:42 +08:00
window.onresize = function temp() {
2025-04-27 10:05:51 +08:00
that.height = document.documentElement.clientHeight - 94.5 + "px;"
}
2021-06-17 20:17:42 +08:00
}
2025-04-27 10:05:51 +08:00
}
2021-06-17 20:17:42 +08:00
</script>