123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <template>
- <el-button v-bind="$props" v-if="isShow" @click="handleClick">
- <slot></slot>
- </el-button>
- </template>
- <script>
- import { mapGetters } from 'vuex'
- export default {
- props: {
- type: {
- type: String,
- default: 'default'
- },
- size: String,
- icon: {
- type: String,
- default: ''
- },
- nativeType: {
- type: String,
- default: 'button'
- },
- loading: Boolean,
- disabled: Boolean,
- plain: Boolean,
- autofocus: Boolean,
- round: Boolean,
- circle: Boolean,
- authorId: Number
- },
- computed: {
- ...mapGetters({
- getAuthIds: 'permission/getAuthIds'
- }),
- isShow() {
- if (this.authorId) {
- return this.getAuthIds.includes(this.authorId)
- } else {
- return false
- }
- }
- },
- methods: {
- handleClick(evt) {
- this.$emit('click', evt)
- }
- }
- }
- </script>
|