Skip to content

Instantly share code, notes, and snippets.

@kusa-mochi
Created March 14, 2020 03:46
Show Gist options
  • Save kusa-mochi/6ca8a8a0a5e1386fd7dc281cc515485f to your computer and use it in GitHub Desktop.
Save kusa-mochi/6ca8a8a0a5e1386fd7dc281cc515485f to your computer and use it in GitHub Desktop.
import { reactive, computed } from "vue";
export default function {
const state = reactive({
count: 0,
double: computed(() => state.count * 2)
});
function increment() {
state.count++;
}
return {
count,
double,
increment
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment