mirror of
https://github.com/Lissy93/dashy.git
synced 2025-07-23 13:45:33 +02:00
👽 Add getter to return specific item
This commit is contained in:
parent
685d559716
commit
36cea32ee5
@ -35,6 +35,14 @@ const store = new Vuex.Store({
|
||||
visibleComponents(state, getters) {
|
||||
return componentVisibility(getters.appConfig);
|
||||
},
|
||||
getItemById: (state, getters) => (id) => {
|
||||
let item;
|
||||
getters.sections.forEach(sec => {
|
||||
const foundItem = sec.items.find((itm) => itm.id === id);
|
||||
if (foundItem) item = foundItem;
|
||||
});
|
||||
return item;
|
||||
},
|
||||
},
|
||||
mutations: {
|
||||
[UPDATE_CONFIG](state, config) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user