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

<script>
import BaseLink from "@/components/BaseLink/index.vue";
export default {
  name: 'DeviceLink',
  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:device:query'])) {
        this.$router.push(`/view/device/${this.id}`);
      }
    }
  }
}
</script>
