index.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <div>
  3. <svg t="1492500959545" @click="toggleClick" class="svg-icon hamburger" :class="{'is-active':isActive}" style="" viewBox="0 0 1024 1024"
  4. version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1691" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64">
  5. <path d="M966.8023 568.849776 57.196677 568.849776c-31.397081 0-56.850799-25.452695-56.850799-56.850799l0 0c0-31.397081 25.452695-56.849776 56.850799-56.849776l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.849776l0 0C1023.653099 543.397081 998.200404 568.849776 966.8023 568.849776z"
  6. p-id="1692"></path>
  7. <path d="M966.8023 881.527125 57.196677 881.527125c-31.397081 0-56.850799-25.452695-56.850799-56.849776l0 0c0-31.397081 25.452695-56.849776 56.850799-56.849776l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.849776l0 0C1023.653099 856.07443 998.200404 881.527125 966.8023 881.527125z"
  8. p-id="1693"></path>
  9. <path d="M966.8023 256.17345 57.196677 256.17345c-31.397081 0-56.850799-25.452695-56.850799-56.849776l0 0c0-31.397081 25.452695-56.850799 56.850799-56.850799l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.850799l0 0C1023.653099 230.720755 998.200404 256.17345 966.8023 256.17345z"
  10. p-id="1694"></path>
  11. </svg>
  12. </div>
  13. </template>
  14. <script>
  15. export default {
  16. name: 'hamburger',
  17. props: {
  18. isActive: {
  19. type: Boolean,
  20. default: false
  21. },
  22. toggleClick: {
  23. type: Function,
  24. default: null
  25. }
  26. }
  27. }
  28. </script>
  29. <style scoped>
  30. .hamburger {
  31. display: inline-block;
  32. cursor: pointer;
  33. width: 20px;
  34. height: 20px;
  35. transform: rotate(0deg);
  36. transition: .38s;
  37. transform-origin: 50% 50%;
  38. }
  39. .hamburger.is-active {
  40. transform: rotate(90deg);
  41. }
  42. </style>