<template>
  <base-link :id="id" :text="text" :size="size" @click="handleClick" :permissions="['bst:user:query']"/>
</template>

<script>
import BaseLink from "@/components/BaseLink/index.vue";
export default {
  name: 'UserLink',
  components: {BaseLink},
  props: {
    id: {
      type: String,
      default: null
    },
    text: {
      type: String,
      default: null,
    },
    size: {
      type: String,
      default: "small"
    }
  },
  methods: {
    handleClick() {
      if (this.id != null && this.checkPermi(['bst:user:query'])) {
        this.$router.push(`/view/user/${this.id}`);
      }
    }
  }
}
</script>
