Skip to content

Instantly share code, notes, and snippets.

@sonicoder86
Created July 14, 2020 07:57
Show Gist options
  • Save sonicoder86/1b544f94e2c15cb13ff4a19b23707e59 to your computer and use it in GitHub Desktop.
Save sonicoder86/1b544f94e2c15cb13ff4a19b23707e59 to your computer and use it in GitHub Desktop.
You Might Not Need Vuex - part 2
<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