<template>
  <el-link
    :style="style"
    :disabled="id == null || !checkPermi(permissions)"
    :underline="false"
    type="primary"
    v-on="$listeners"
  >
    {{ text | dv }}
  </el-link>
</template>

<script>
import {checkPermi} from "@/utils/permission";

export default {
  name: 'BaseLink',
  methods: {checkPermi},
  props: {
    id: {
      type: String,
      default: null
    },
    text: {
      type: String,
      default: null
    },
    size: {
      type: String,
      default: "small"
    },
    permissions: {
      type: Array,
      default: () => []
    }
  },
  computed: {
    style() {
      return {
        fontSize: this.size === "mini" ? "12px" : null
      }
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
