/**
 * @Author: lb
 * @CreateDate: 2022.8.8
 * @Modifier: 
 * @ModifiedDate: 
 * 表格里的文本组件
 * 一般用途：展示查看详情入口
 */
export default {
  name: 'TableTextComponent',
  props: {
    injectData: {
      type: Object,
      default: () => ({})
    }
  },
  data() {
    return {
      // for i18n inject:
      defaultText: '查看详情'
    }
  },
  methods: {
    emitClick() {
      this.$emit('emitData', {
        action: this.injectData.actionName || 'view-detail-action',
        data: this.injectData.emitFullData ? this.injectData : { id: this.injectData.id }
      })
    }
  },
  render: function (h) {
    return h('span', null, [h('el-button', { props: { type: 'text' }, style: { paddingLeft: 0 } }, this.injectData.buttonContent || this.defaultText)])
  }
}