I'm trying to include get() and set() functions inside the computed method using Composition API. However, this is possible using an option API like this.
export default {
name: "Home",
computed: {
colorCode: {
get(){
},
set(){
}
}
},
};
Is there any way to do this same task with Composition API? Really appreciate if somebody can help me in this situation, I was trying like this,
setup() {
const colorCodeGet = computed(() => {
return $store.state.colorCode;
});
const colorCodeSet = computed(() => {});
return { colorCode };
},
computedhas a signature that matches this feature. It actually does, vuejs.org/guide/essentials/computed.html#writable-computed