diff --git a/packages/frontend/src/pages/settings/navbar.vue b/packages/frontend/src/pages/settings/navbar.vue
index dc13477268..b3b33b8026 100644
--- a/packages/frontend/src/pages/settings/navbar.vue
+++ b/packages/frontend/src/pages/settings/navbar.vue
@@ -5,27 +5,27 @@
e.item.classList.add('active')"
- @end="e=>e.item.classList.remove('active')"
+ :handle="'.' + $style.itemHandle"
+ @start="e => e.item.classList.add('active')"
+ @end="e => e.item.classList.remove('active')"
>
-
- {{ navbarItemDef[element]?.title ?? i18n.ts.divider }}
-
+
+ {{ navbarItemDef[element.type]?.title ?? i18n.ts.divider }}
+
- {{ i18n.ts.addItem }}
+ {{ i18n.ts.addItem }}
{{ i18n.ts.default }}
{{ i18n.ts.save }}
@@ -56,7 +56,10 @@ import { deepClone } from '@/scripts/clone';
const Sortable = defineAsyncComponent(() => import('vuedraggable').then(x => x.default));
-const items = ref(deepClone(defaultStore.state.menu));
+const items = ref(defaultStore.state.menu.map(x => ({
+ id: Math.random().toString(),
+ type: x,
+})));
const menuDisplay = computed(defaultStore.makeGetterSetter('menuDisplay'));
@@ -81,7 +84,10 @@ async function addItem() {
}],
});
if (canceled) return;
- items.value = [...items.value, item];
+ items.value = [...items.value, {
+ id: Math.random().toString(),
+ type: item,
+ }];
}
function removeItem(index: number) {
@@ -89,12 +95,15 @@ function removeItem(index: number) {
}
async function save() {
- defaultStore.set('menu', items.value);
+ defaultStore.set('menu', items.value.map(x => x.type));
await reloadAsk();
}
function reset() {
- items.value = defaultStore.def.menu.default;
+ items.value = defaultStore.def.menu.default.map(x => ({
+ id: Math.random().toString(),
+ type: x,
+ }));
}
watch(menuDisplay, async () => {
@@ -110,75 +119,44 @@ definePageMetadata({
icon: 'ti ti-list',
});
-