<template>
	<iframe src="/iconLibrary/demo_index.html" scrolling="auto" frameborder="0" width="100%"
		style="overflow: hidden;height: 1500px;"></iframe>
</template>
<!-- :style="'height:' +iframeHight + 'px'" -->
<!-- :style="'height:' +iframeHight" -->
<script>
export default {
	data() {
		return {
			// iframeHight:setHeight()
			iframeHight: '',
			clientHeight: document.documentElement.clientHeight,
			// mainHight:document.getElementsByClassName("app-main")[0].offsetHeight
		}
	},
	mounted() {
		this.setHeight()
		// window.onresize = () => {
		//         this.clientHeight = document.documentElement.clientHeight;
		// 		console.log("页面变化")
		//     }
	},

	watch: {
		clientHeight(newValue, oldValue) {
			if (newValue) {
				console.log("高度变化")
				this.setHeight()
			}
		},
		// mainHight(newValue, oldValue) {
		//        if(newValue) {
		// 		console.log(this.mainHight,"mainHight")
		//        }
		//    },
	},
	methods: {
		setHeight() {
			var arr = document.getElementsByClassName("app-main")[0]
			this.iframeHight = arr.offsetHeight - 3
		}
	}
}
</script>
