Blame view

HHECS.Web/src/components/Hamburger/index.vue 1.15 KB
胡菁 authored
1
<template>
胡菁 authored
2
  <div style="padding: 0 15px" @click="toggleClick">
胡菁 authored
3
    <svg
胡菁 authored
4
      :class="{ 'is-active': isActive }"
胡菁 authored
5
6
7
8
9
10
      class="hamburger"
      viewBox="0 0 1024 1024"
      xmlns="http://www.w3.org/2000/svg"
      width="64"
      height="64"
    >
胡菁 authored
11
12
13
      <path
        d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z"
      />
胡菁 authored
14
15
16
17
18
19
    </svg>
  </div>
</template>

<script>
export default {
胡菁 authored
20
  name: "Hamburger",
胡菁 authored
21
22
23
  props: {
    isActive: {
      type: Boolean,
胡菁 authored
24
25
      default: false,
    },
胡菁 authored
26
27
28
  },
  methods: {
    toggleClick() {
胡菁 authored
29
30
31
32
      this.$emit("toggleClick");
    },
  },
};
胡菁 authored
33
34
35
36
37
38
39
40
41
42
43
44
45
46
</script>

<style scoped>
.hamburger {
  display: inline-block;
  vertical-align: middle;
  width: 20px;
  height: 20px;
}

.hamburger.is-active {
  transform: rotate(180deg);
}
</style>