ArrowButton.vue 963 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <!-- eslint-disable vue/multi-word-component-names -->
  2. <template>
  3. <div class="arrow-button" :class="`point-to-${pointTo}`" @click="$emit('click')"></div>
  4. </template>
  5. <script lang="ts" setup>
  6. /** 箭头按钮,宽高固定 90 * 76 */
  7. withDefaults(
  8. defineProps<{
  9. pointTo: 'left' | 'right' | 'bottom' | 'top';
  10. }>(),
  11. {
  12. pointTo: 'left',
  13. }
  14. );
  15. defineEmits(['click']);
  16. </script>
  17. <style lang="less" scoped>
  18. .arrow-button {
  19. height: 90px;
  20. width: 76px;
  21. background-image: url('@/assets/images/company/arrow-button.png');
  22. background-size: 100% auto;
  23. background-repeat: no-repeat;
  24. }
  25. .arrow-button:hover {
  26. background-image: url('@/assets/images/company/arrow-button-hover.png');
  27. }
  28. .point-to-left {
  29. transform: rotate(0deg);
  30. }
  31. .point-to-right {
  32. transform: rotate(180deg);
  33. }
  34. .point-to-top {
  35. transform: rotate(90deg);
  36. }
  37. .point-to-bottom {
  38. transform: rotate(270deg);
  39. }
  40. </style>