AppButtonLink.vue 752B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <script setup>
  2. import { Link } from '@inertiajs/inertia-vue3'
  3. defineProps({
  4. inertiaLink: {
  5. type: Boolean,
  6. default: true,
  7. },
  8. icon: {
  9. type: String,
  10. required: true,
  11. },
  12. label: String,
  13. })
  14. </script>
  15. <template>
  16. <Link
  17. v-if="inertiaLink"
  18. class="p-button p-component"
  19. as="button"
  20. type="button"
  21. >
  22. <span
  23. v-if="icon"
  24. class="p-button-icon p-button-icon-left"
  25. :class="icon"
  26. ></span>
  27. <span v-if="label" class="p-button-label">{{ label }}</span>
  28. </Link>
  29. <a v-else class="p-button p-component">
  30. <span
  31. v-if="icon"
  32. class="p-button-icon p-button-icon-left"
  33. :class="icon"
  34. ></span>
  35. <span v-if="label" class="p-button-label">{{ label }}</span>
  36. </a>
  37. </template>