ActionColomns.vue 1006 B

12345678910111213141516171819202122232425262728293031323334
  1. <template>
  2. <div class="flex items-center justify-center">
  3. <el-space :size="space">
  4. <div v-for="item in props.actionIcons" :key="item.label" @click="item.onClick">
  5. <div v-if="item.label === '重置密码'" style="font-size: 10px;color: #629bf9;cursor: pointer;">{{item.label}}</div>
  6. <el-tooltip v-else :content="item.label" effect="light">
  7. <el-icon v-if="props.style === 'icon'" :color="props.color" :size="props.size">
  8. <component :is="item.icon" />
  9. </el-icon>
  10. <img
  11. v-if="props.style === 'img'"
  12. :src="item.icon"
  13. :style="{ width: `${props.size}px` }"
  14. />
  15. </el-tooltip>
  16. </div>
  17. </el-space>
  18. </div>
  19. </template>
  20. <script setup lang="ts">
  21. import { ActionItem } from '@/components/Table';
  22. const props = defineProps<{
  23. space: number;
  24. size: number;
  25. color: string;
  26. style: 'img' | 'icon';
  27. actionIcons: ActionItem[];
  28. }>();
  29. </script>
  30. <style scoped></style>