refactor: classic.sidebar.vue to composition api #59
Loading…
Reference in a new issue
No description provided.
Delete branch ":refactor/classic.sidebar.vue"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -104,0 +61,4 @@
}
return false;
});
const adminOrModerator = $computed(() => $i && ($i.isAdmin || $i.isModerator));
You can use
iAmModerator
from@/account
instead.@ -104,0 +67,4 @@
(ev: 'change-view-mode'): void;
}>();
watch(() => defaultStore.reactiveState.menuDisplay.value, () => {
You are using a getter of a ref value¹, but you could use the ref directly here², like this:
¹ According to the type definition of
reactiveState
it is aRef
.² See type definition of
watch
: https://vuejs.org/api/reactivity-core.html#watchI'm also thinking that the arrow function to call
calcViewState
is unnecessary and you could probably just put the function name directly.@ -136,0 +92,4 @@
}
function post(): void {
os.post();
This function seems quite simple, just to not upset the
os.post
function by passing the event data as parameters. Maybe it could be "inlined" in the template as an arrow function?@ -136,0 +95,4 @@
os.post();
}
function more(ev: { currentTarget: any; target: any; }): void {
Wouldn't
MouseEvent
be the right type to use here as well?@ -136,0 +108,4 @@
}
window.addEventListener('resize', calcViewState);
calcViewState();
Maybe group these uses of
calcViewState
with the function definition above since they are related.