Created
January 16, 2018 16:18
-
-
Save hibuno/98d00cd576a401e02eaf56a9a8c947ab to your computer and use it in GitHub Desktop.
Adding JavaScript event on profile.vue
This file contains hidden or 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
<template> | |
<div> | |
<h2>Hello Dude!</h2> | |
<p>{{ message }}</p> | |
<input type="text" v-model="message"> | |
<button @click="showAlert">Show Message</button> | |
</div> | |
</template> | |
<script> | |
export default { | |
data () { | |
return { | |
message: 'Nuxt it\'s so cool..' | |
} | |
}, | |
methods: { | |
showAlert (e) { | |
alert(this.message) | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment