<template>
	<view class="  ">
		<view class="light-loading" v-if="loading">
			<view class="box">
				<view class="h2">加载中...</view>
				<view class="span"></view>
				<view class="span"></view>
				<view class="span"></view>
				<view class="span"></view>
				<view class="span"></view>
				<view class="span"></view>
			</view>
		</view>
	</view>
</template>
<script>
	export default { 
		data() {
			return {
				// loading: this.$store.state.loading.loading
			};
		},
		onLoad() {
			this.switch_loading()
		},
		methods: {
			switch_loading() {
				this.$store.commit("switch_loading")
			}
		},
		//实测直接在标签属性里写  $store.state.XX  拿不到数据  因此这里经过 计算属性去监听一下
		computed: {
			loading() { 
				return this.$store.state.loading.loading
			},
		}
	}
</script>
<style>
</style>
