Last active
February 23, 2020 08:55
-
-
Save livoist/c5930b336fe5423134a4e45af4f34e5a 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
<script> | |
// mixins.js | |
export default { | |
props: { | |
isOpen: { | |
default: true | |
} | |
}, | |
data() { | |
return { | |
shown: this.isOpen | |
} | |
}, | |
methods: { | |
hide() { | |
this.shown = false | |
}, | |
show() { | |
this.shown = true | |
}, | |
toggle() { | |
this.shown =! this.shown | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment