You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

24 lines
385 B

import { computed, reactive, readonly } from "vue"
const state = reactive({
count: 0,
})
const ttc = computed(
() => state.count * 1.085
)
const inc = (amount: number): number => {
return (state.count += amount)
}
function reset(): number {
return state.count = 0
}
export default {
state: readonly(state),
getters: { ttc },
actions: { inc, reset }
}