123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <!--
- <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>
|