index.vue 1.78 KB
Newer Older
Pan's avatar
Pan committed
1
<template>
Pan's avatar
Pan committed
2
  <div>
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
    <svg
      :class="{'is-active':isActive}"
      t="1492500959545"
      class="hamburger"
      style=""
      viewBox="0 0 1024 1024"
      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"
      @click="toggleClick">
      <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"
        p-id="1692" />
      <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"
        p-id="1693" />
      <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"
        p-id="1694" />
Pan's avatar
Pan committed
25 26
    </svg>
  </div>
Pan's avatar
Pan committed
27 28 29
</template>

<script>
Pan's avatar
Pan committed
30
export default {
31
  name: 'Hamburger',
Pan's avatar
Pan committed
32 33 34 35 36 37 38 39
  props: {
    isActive: {
      type: Boolean,
      default: false
    },
    toggleClick: {
      type: Function,
      default: null
Pan's avatar
Pan committed
40
    }
Pan's avatar
Pan committed
41 42
  }
}
Pan's avatar
Pan committed
43 44 45
</script>

<style scoped>
Pan's avatar
Pan committed
46
.hamburger {
Pan's avatar
Pan committed
47 48 49 50 51 52 53
	display: inline-block;
	cursor: pointer;
	width: 20px;
	height: 20px;
	transform: rotate(90deg);
	transition: .38s;
	transform-origin: 50% 50%;
Pan's avatar
Pan committed
54 55
}
.hamburger.is-active {
Pan's avatar
Pan committed
56
	transform: rotate(0deg);
Pan's avatar
Pan committed
57
}
Pan's avatar
Pan committed
58
</style>