Skip to content

Instantly share code, notes, and snippets.

@ryandejaegher
Last active June 7, 2021 12:17
Show Gist options
  • Save ryandejaegher/b3bf4fec59be3ab78bc2f28ac95284c9 to your computer and use it in GitHub Desktop.
Save ryandejaegher/b3bf4fec59be3ab78bc2f28ac95284c9 to your computer and use it in GitHub Desktop.
header #vue
<template lang="pug">
<div>
p(@click="handler") {{ greeting }} World!
h1 Hello World
</div>
</template>
<script>
export default {
methods: {
handler() {
this.greet = !this.greet;
this.greet ? this.greeting = 'Hi' : this.greeting = "Hello";
alert('clicked')
}
},
data() {
return {
greet: true,
greeting: 'Hello'
}
}
}
</script>
<style>
body {
font-family: sans-serif;
}
</style>
{
"scripts": [],
"styles": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment