<!--
 * @Author: xiejiang
 * @Date: 2024-11-28 09:24:26
 * @LastEditors: xiejiang
 * @LastEditTime: 2024-12-11 15:38:35
 * @Description:  table操作按钮
 * Copyright（c）2024 by 好老师教育科技有限公司 All right Reserved.
-->
<template>
  <!-- <t-tooltip :content="props.content"> -->
  <t-button
    class="operate-btn"
    variant="text"
    @click="handleClick"
    :disabled="props.disabled"
    :loading="props.loading"
    v-bind="$attrs"
  >
    <template #icon> <slot></slot></template>
    {{ props.content }}
  </t-button>
  <!-- </t-tooltip> -->
</template>

<script lang="ts" setup name="OperateButton">
interface Props {
  content?: string
  text?: string
  disabled?: boolean
  loading?: boolean
}
// 组件 props
const props = withDefaults(defineProps<Props>(), {
  content: '',
  disabled: false,
  loading: false
})

// 组件 emit
const emit = defineEmits<{
  (e: 'click', ...args: any[]): void
}>()

const handleClick = () => {
  emit('click')
}
</script>
<style lang="less" scoped>
.t-button--variant-text {
  padding: 0 10px 0 0;
  color: var(--td-brand-color-8);
}

.t-is-disabled {
  color: var(--td-gray-color-);
}
</style>
