mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-22 16:11:29 +00:00
feat(admin): add route reordering with up/down buttons
This commit is contained in:
parent
ac8b4a77b8
commit
7ee1e5899f
4 changed files with 54 additions and 3 deletions
|
|
@ -19,6 +19,22 @@
|
|||
<span v-if="route.fallback" class="badge fallback">{{ t("route.fallback") }}</span>
|
||||
</div>
|
||||
<div class="card-actions">
|
||||
<button
|
||||
class="icon-btn"
|
||||
:disabled="atFirst"
|
||||
:title="t('route.moveUp')"
|
||||
@click="$emit('move', route, -1)"
|
||||
>
|
||||
↑
|
||||
</button>
|
||||
<button
|
||||
class="icon-btn"
|
||||
:disabled="atLast"
|
||||
:title="t('route.moveDown')"
|
||||
@click="$emit('move', route, 1)"
|
||||
>
|
||||
↓
|
||||
</button>
|
||||
<button class="icon-btn" :title="t('routeEditor.editTitle')" @click="$emit('edit', route)">
|
||||
✎
|
||||
</button>
|
||||
|
|
@ -67,11 +83,12 @@ import { fmtMatch } from "~/types";
|
|||
|
||||
const { t } = useI18n();
|
||||
|
||||
const props = defineProps<{ route: Route }>();
|
||||
const props = defineProps<{ route: Route; atFirst?: boolean; atLast?: boolean }>();
|
||||
const emit = defineEmits<{
|
||||
(e: "toggle", route: Route): void;
|
||||
(e: "edit", route: Route): void;
|
||||
(e: "delete", route: Route): void;
|
||||
(e: "move", route: Route, dir: -1 | 1): void;
|
||||
}>();
|
||||
|
||||
function onToggle(event: Event): void {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue