提交 | 用户 | 时间
|
fd2207
|
1 |
<template> |
懒 |
2 |
<div style="padding: 0 15px;" @click="toggleClick"> |
|
3 |
<svg |
|
4 |
:class="{'is-active':isActive}" |
|
5 |
class="hamburger" |
|
6 |
viewBox="0 0 1024 1024" |
|
7 |
xmlns="http://www.w3.org/2000/svg" |
|
8 |
width="64" |
|
9 |
height="64" |
|
10 |
> |
|
11 |
<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" /> |
|
12 |
</svg> |
|
13 |
</div> |
|
14 |
</template> |
|
15 |
|
|
16 |
<script> |
|
17 |
export default { |
|
18 |
name: 'Hamburger', |
|
19 |
props: { |
|
20 |
isActive: { |
|
21 |
type: Boolean, |
|
22 |
default: false |
|
23 |
} |
|
24 |
}, |
|
25 |
methods: { |
|
26 |
toggleClick() { |
|
27 |
this.$emit('toggleClick') |
|
28 |
} |
|
29 |
} |
|
30 |
} |
|
31 |
</script> |
|
32 |
|
|
33 |
<style scoped> |
|
34 |
.hamburger { |
|
35 |
display: inline-block; |
|
36 |
vertical-align: middle; |
|
37 |
width: 20px; |
|
38 |
height: 20px; |
|
39 |
} |
|
40 |
|
|
41 |
.hamburger.is-active { |
|
42 |
transform: rotate(180deg); |
|
43 |
} |
|
44 |
</style> |