<template>
  <el-link type="primary" @click="handleClick" :disabled="id == null">{{name | defaultValue}}</el-link>
</template>

<script>
export default {
  name: 'UserLink',
  props: {
    id: {
      type: String,
      default: null
    },
    name: {
      type: String,
      default: null,
    }
  },
  methods: {
    handleClick() {
      this.$emit('click');
      this.$router.push({path: `/smUser/user/${this.id}`})
    }
  }
}
</script>
