I am trying to create a searchable table element where user can also search and filter the returned result. but i can't seem to get how to set the value in the computed property setter.
but I keep getting tons of errors like: RangeError: Maximum call stack size exceeded
import { watch } from "vue";
import { computed, ref, reactive } from "vue";
import { useStore } from "vuex";
const searchText = ref("");
watch(searchText, () => filterHistory());
const user = computed(() => store.getters["profile/getProfile"]);
const reversedHistory = computed({
get() {
return user.value.history.reverse();
},
set(value) {
reversedHistory.value = value;
},
});
const filterHistory = () => {
let newHistory = reversedHistory.value.filter(
(item) => searchText === item.person
);
rerturn newHistory
};