1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <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>
|