chore(frontend): reduce redundancies
This commit is contained in:
1 parent
dac5d201cd
commit
75dac1e459
8 files changed
+65
-97
No files matched your search
@@ -1,5 +1,6 @@
|
||||
// Global utility functions related with UI functionality
|
||||
|
||||
import { ref } from 'vue';
|
||||
import router from './router'
|
||||
|
||||
export function goto (path) {
|
||||
@@ -33,6 +34,15 @@ export function contextMenu (entries) {
|
||||
});
|
||||
}
|
||||
|
||||
// Helper object to manage track toggable ui elements
|
||||
export function useToggleSet () {
|
||||
const state = ref({});
|
||||
return {
|
||||
has(key) { return Boolean(state.value[key]); },
|
||||
toggle(key) { state.value[key] = !state.value[key]; },
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// === Events === //
|
||||
|
||||
|
||||
Reference in new issue
Block a user