Skip to content

Commit a2cb5f5

Browse files
author
=
committed
Emit event to change props and close menu list component
1 parent a7d54b5 commit a2cb5f5

File tree

4 files changed

+105
-94
lines changed

4 files changed

+105
-94
lines changed

.idea/workspace.xml

Lines changed: 79 additions & 91 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/js/app.js

Lines changed: 15 additions & 2 deletions
Large diffs are not rendered by default.

resources/js/components/_MenuHamburger.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</div>
1010

1111
<portal to="header-after">
12-
<menu-list :active="active"></menu-list>
12+
<menu-list :active="active" @change="activated"></menu-list>
1313
</portal>
1414
</div>
1515
</template>
@@ -29,6 +29,10 @@
2929
methods: {
3030
check() {
3131
this.active = (this.active !== true);
32+
},
33+
34+
activated() {
35+
this.active = false;
3236
}
3337
},
3438
}

resources/js/components/_MenuList.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@
5656
default: false
5757
},
5858
},
59+
60+
watch: {
61+
$route() {
62+
this.$emit('change', this.active);
63+
}
64+
},
5965
}
6066
</script>
6167

0 commit comments

Comments
 (0)