Change open to isOpen, add toggle method
This commit is contained in:
parent
5aa6f7dc9d
commit
96eb594600
|
@ -3,7 +3,7 @@
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="w-full p-3 block sm:hidden bg-blue-100 text-sm text-grey-600 text-left focus:outline-none"
|
class="w-full p-3 block sm:hidden bg-blue-100 text-sm text-grey-600 text-left focus:outline-none"
|
||||||
@click="open = !open"
|
@click="toggle"
|
||||||
>
|
>
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<div>
|
<div>
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div class="xl:max-w-6xl mx-auto px-4 sm:block" :class="[ open ? 'block' : 'hidden' ]">
|
<div class="xl:max-w-6xl mx-auto px-4 sm:block" :class="[ isOpen ? 'block' : 'hidden' ]">
|
||||||
<div class="mt-2 sm:mt-0">
|
<div class="mt-2 sm:mt-0">
|
||||||
<nav class="flex flex-wrap pb-1 md:p-0 -mx-3 sm:-mx-0">
|
<nav class="flex flex-wrap pb-1 md:p-0 -mx-3 sm:-mx-0">
|
||||||
<div
|
<div
|
||||||
|
@ -42,7 +42,7 @@ export default {
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
activeTab: 0,
|
activeTab: 0,
|
||||||
open: false,
|
isOpen: false,
|
||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
title: 'Home',
|
title: 'Home',
|
||||||
|
@ -74,7 +74,13 @@ export default {
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
navText: function () {
|
navText: function () {
|
||||||
return this.open ? 'Hide' : 'Show'
|
return this.isOpen ? 'Hide' : 'Show'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
toggle () {
|
||||||
|
this.isOpen = !this.isOpen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue