<!-- 

			<permissionsSlot class="button-for-box" :hasPermi="'demo:demo:demo'"> 
			</permissionsSlot>

 -->

<template>
	<view class="permissionsSlot" v-if='permissionType'>
		<slot></slot>
	</view>
</template>

<script>
	export default {
		name: "permissionsSlot",
		props: {
			hasPermi: '',
		},
		data() {
			return {
				permissionType: false,
				objStore: uni.getStorageSync('permissions'),
			}
		},
		created() {

		},
		mounted() {
			this.permissionVerification();
		},
		methods: {
			permissionVerification() {
				let self = this;
				// console.log('self.objStore',self.objStore)
				// console.log('self.hasPermi',self.hasPermi)
				if (this.objStore[0] == "*:*:*" || self.hasPermi === "") {
					this.$set(self, 'permissionType', true);
					return
				}
				for (let i = 0; i < self.objStore.length; i++) {
					if (self.objStore[i] === self.hasPermi) {
						this.$set(self, 'permissionType', true);
						return
					}
				}
			},
		},
	}
</script>

<style lang="stylus" scoped>
	.permissionsSlot {
		margin: 0;
		padding: 0;
	}
</style>