Skip to content

Instantly share code, notes, and snippets.

@Kcko
Last active March 26, 2024 10:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kcko/585234320ef9c6b53be9a2b7534a59b8 to your computer and use it in GitHub Desktop.
Save Kcko/585234320ef9c6b53be9a2b7534a59b8 to your computer and use it in GitHub Desktop.
<template>
<p>{{ counterInfo.currentValue }} / {{ counterInfo.nextValue }}</p>
<button @click="pokus().a(50)">Pokus</button>
</template>
<script>
methods: {
pokus() {
return {
a: n => {
this.counter = n;
},
};
},
},
computed: {
counterInfo() {
return {
currentValue: this.counter,
nextValue: this.counter + 1,
// tohle nejde :D
beforeValue: () => {
return this.counter - 1;
},
};
},
},
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment