Created
August 9, 2018 06:45
-
-
Save chihirokaasan/b88e3e0cfb25bc15b25aea3fe08cb49e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
$('#btn').on('click', function() { | |
$(this).toggleClass('is-active'); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p v-on:click="toggleMenu">menuの開閉</p> | |
<div id="navMenu" :class="{'is-active': isActive}"> | |
<menu> | |
<ul class="menu"> | |
<li><a href="#">menu1</a></li> | |
<li><a href="#">menu2</a></li> | |
<li><a href="#">menu3</a></li> | |
<li><a href="#">menu4</a></li> | |
</ul> | |
</menu> | |
</div> | |
<script> | |
export default { | |
data: () => { | |
return {isActive: false} | |
}, | |
methods: { | |
toggleMenu () { | |
this.isActive = !this.isActive | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment