123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <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() {
- console.log('12312321123132123123')
- },
- mounted(){
- console.log('657575466446')
- this.permissionVerification();
- },
- methods:{
- permissionVerification(){
- let self = this;
- console.log('self.objStore',self.objStore)
- console.log('self.hasPermi',self.hasPermi)
- if(this.objStore[0] == "*:*:*"){
- 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>
|