js
<script>
window.onload=function(){
var Cwidth = document.documentElement.clientWidth;
var Cheight = document.documentElement.clientHeight;
var fbox = document.getElementById("iframepage");
var FBOX = document.getElementById("box");
fbox.style.width=Cwidth + 'px';
fbox.style.height=Cheight + 'px';
}
</script>
vue
<script> import {mapState,mapGetters,mapMutations} from 'vuex';
export default { data() {
return {
} }, methods:{ ...mapMutations([])},
mounted(){
let windowHeight = document.body.clientHeight;
console.log(`window height: ${windowHeight}`);
let domHeight = document.getElementById("baoqi").clientHeight;
console.log(`dom height: ${domHeight}`);
if (domHeight < windowHeight) {
document.getElementById("baoqi").style.height =
windowHeight + "px";
} }, watch:{}, computed:{ ...mapState({}), ...mapGetters([])
}, components: {
} } </script>