Created
July 14, 2020 07:57
-
-
Save sonicoder86/1b544f94e2c15cb13ff4a19b23707e59 to your computer and use it in GitHub Desktop.
You Might Not Need Vuex - part 2
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
<template> | |
<div>{{ state.counter }}</div> | |
<button type="button" @click="state.counter++">Increment</button> | |
</template> | |
<script> | |
import { reactive } from 'vue'; | |
export default { | |
setup() { | |
const state = reactive({ counter: 0 }); | |
return { state }; | |
} | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment