ShortcutKeySpin.vue 592 B

123456789101112131415161718192021222324252627282930313233
  1. <template>
  2. <span class="shortcut-key-spin">
  3. <i v-if="ARROW_CONT" :class="ARROW_CONT"></i>
  4. <i v-else>{{ data }}</i>
  5. </span>
  6. </template>
  7. <script>
  8. export default {
  9. name: "shortcut-key-spin",
  10. props: {
  11. data: {
  12. type: String,
  13. default: "",
  14. },
  15. },
  16. computed: {
  17. ARROW_CONT() {
  18. const arrowIcon = {
  19. ArrowUp: "el-icon-top",
  20. ArrowDown: "el-icon-bottom",
  21. ArrowLeft: "el-icon-back",
  22. ArrowRight: "el-icon-right",
  23. };
  24. return arrowIcon[this.data];
  25. },
  26. },
  27. data() {
  28. return {};
  29. },
  30. methods: {},
  31. };
  32. </script>