<template>
	<view>
		<model1 :shareNumber='shareNumber' :isDefault='isDefault' v-if="modelId==3||modelId==1" :templateDetail='templateData' :isShare='isShare' :isLook='isLook'></model1>
		<model2 :shareNumber='shareNumber' :isDefault='isDefault' v-if="modelId==4" :templateDetail='templateData' :isShare='isShare' :isLook='isLook'></model2>
		<model3 :shareNumber='shareNumber' :isDefault='isDefault' v-if="modelId==5" :templateDetail='templateData' :isShare='isShare' :isLook='isLook'></model3>
	</view>
</template>

<script>
	import model1 from './modeltemplate/model_1.vue';
	import model2 from './modeltemplate/model_2.vue'
	import model3 from './modeltemplate/model_3.vue'
	export default {
		props: {
			// 浏览数量
			shareNumber: {
				type: Number,
				default:0
			},
			// 是否显示默认数据
			isDefault: {
				type: Boolean,
				default:true
			},
			templateData: {
				type: Object,
				default: ()=>{
					return {}
				}
			},
			isShare:{
				type: Boolean,
				default:false
			},
			//1为模板2为用户
			isLook:{
				type: Number,
				default:0
			},
			modelId:{
				type: Number,
				default:0
			},
		},
		components: {
			model1,
			model2,
			model3
		},
		data() {
			return {
				model: 0
			}
		},
		onLoad() {
			console.log('233');
			uni.postMessage('打开页面')
		},
		onUnload() {
			uni.postMessage('关闭页面')
		}
	}
</script>
