<template>
	<view class="content">
		时间:{{id}}
		<button @click="t1">更新时间-父按钮</button>
		<button @click="t2">更新时间-父按钮-直接赋值</button> 
		<view class="input-group">
			<slot name="page"></slot>
		</view>
		<view v-if="footer" class="footer">
			<p class="right">{{$company}}技术支持</p>
			<view class="left">
				<uni-icons v-if="serverInfo.networkFlag==='内网'" type="neiwang" color="#cbcaca" size="13"/>
				<uni-icons v-else-if="serverInfo.networkFlag==='外网'" type="waiwang" color="#cbcaca" size="13"/>
				<uni-icons v-else type="weizhi" color="#cbcaca" size="13"/>				
				<p>{{serverInfo.networkFlag}}</p>
			</view>
		</view>
	</view>
</template>

<script>
  import { mapState, mapMutations } from 'vuex';
  export default {
    data() {
      return {
		
	  }
    },
	props:{ 
		footer:{
			type:Boolean,
			default:true
		}
	},
	created() {
		
	},
	mounted() {
		
	},
    methods: {
		t1(){
			this.test(new Date());
		},
		t2(){
			this.$store.state.id = new Date();
		}, 
		...mapMutations(['test']),
    },
	computed: { 
		...mapState(['id']),
		...mapState(['serverInfo']),
	}
  }
</script>

<style>
	.footer{
		color: #cbcaca;
		padding:0 10rpx;
	}
	.footer .left{
		display: flex;
		float: left;
	}
	.footer .right{
		float: right;
	}
</style>
