0👍
You can manage a filterBy
state in your pinia store which will track the type of filter that have been applied. Then, you can have a computed value with getters like this:
getters: {
filteredArray: (state) => state.filterBy ? state.array.filter((val) => val.type === state.filterBy) : state.array;
}
Source:stackexchange.com