<template>
	<view class="content">
		<intelligent v-if="homeType == 'intelligent'" style="width: 100%;height: 100%;" ref="intelligentRef"></intelligent>
		<iots v-if="homeType == 'iots'" :showToggle="showToggle" :hideToggle="hideToggle" style="width: 100%;height: 100%;" ref="iotsRef"></iots>
	</view>
</template>

<script>
	// 引入页面自己加navbar
	import intelligent from "@/pages/tabbar/module/intelligent.vue"
	// import iots from "@/pages/tabbar/module/iots.vue"
	import iots from "@/pages/tabbar/module/iots2.vue"
	export default {
			data() {
				return {
					homeType:'iots',
					showToggle:false,
					hideToggle:false,
				}
			},
			components:{
				intelligent,
				iots,
			},
			onUnload() {
				console.log("离开页面")
			},
			onShow() {
				console.log("show")
				this.showToggle = !this.showToggle;
			},
			onHide(){
				console.log("hide")
				this.hideToggle = !this.hideToggle;
			}
		}
</script>

<style lang="scss" scoped>
	page,.content {
		height: 100%;
	}
</style>