Skip to content

Commit

Permalink
chore(#150): close menu on route change
Browse files Browse the repository at this point in the history
  • Loading branch information
Decipher committed Aug 29, 2021
1 parent b8609cf commit 72958a4
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion docs/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
class="shadow bg-base-200 drawer flex-grow"
:class="{ 'drawer-mobile': $route.path !== '/' }"
>
<input id="sidebar" type="checkbox" class="drawer-toggle" />
<input
id="sidebar"
type="checkbox"
class="drawer-toggle"
v-model="sidebar"
/>

<main
class="
Expand All @@ -28,3 +33,17 @@
</div>
</div>
</template>

<script>
export default {
data: () => ({
sidebar: false,
}),
watch: {
$route() {
this.sidebar = false
}
}
}
</script>

0 comments on commit 72958a4

Please sign in to comment.