text.vue 1019 B

123456789101112131415161718192021222324252627
  1. <template>
  2. <p>Basic text button</p>
  3. <div class="flex justify-space-between mb-4 flex-wrap gap-4">
  4. <el-button v-for="button in buttons" :key="button.text" :type="button.type" text>{{ button.text }}</el-button>
  5. </div>
  6. <p>Background color always on</p>
  7. <div class="flex justify-space-between mb-4 flex-wrap gap-4">
  8. <el-button v-for="button in buttons" :key="button.text" :type="button.type" text bg>{{ button.text }}</el-button>
  9. </div>
  10. <p>Disabled text button</p>
  11. <div class="flex justify-space-between flex-wrap gap-4">
  12. <el-button v-for="button in buttons" :key="button.text" :type="button.type" text disabled>{{ button.text }}</el-button>
  13. </div>
  14. </template>
  15. <script setup lang="ts">
  16. const buttons = [
  17. { type: '', text: 'plain' },
  18. { type: 'primary', text: 'primary' },
  19. { type: 'success', text: 'success' },
  20. { type: 'info', text: 'info' },
  21. { type: 'warning', text: 'warning' },
  22. { type: 'danger', text: 'danger' },
  23. ] as const
  24. </script>