cleanup routes names
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import {RouterLink, RouterView} from 'vue-router';
|
||||
import {routeNames} from '@/routes';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="mt-4">
|
||||
<div class="flex border-b-2 border-emerald-500">
|
||||
<RouterLink :to="{name: 'market-types'}" class="tab">
|
||||
<RouterLink :to="{name: routeNames.marketTypes}" class="tab">
|
||||
<span>Item Info</span>
|
||||
</RouterLink>
|
||||
<RouterLink to="/market/tracking" class="tab">
|
||||
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import {RouterLink, RouterView} from "vue-router";
|
||||
import {routeNames} from '@/routes';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="mt-4">
|
||||
<div class="flex border-b-2 border-emerald-500">
|
||||
<RouterLink :to="{ name: 'list-rule-books' }" class="tab">
|
||||
<RouterLink :to="{ name: routeNames.listRuleBooks }" class="tab">
|
||||
<span>Rule Books</span>
|
||||
</RouterLink>
|
||||
<RouterLink to="/characters/rules" class="tab">
|
||||
|
||||
@@ -7,6 +7,7 @@ import {BookmarkIcon, BookmarkSlashIcon, ShoppingCartIcon} from '@heroicons/vue/
|
||||
import log from "loglevel";
|
||||
import {computed, ref, watch} from "vue";
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import {routeNames} from "@/routes";
|
||||
import {computedAsync} from "@vueuse/core";
|
||||
|
||||
const buyModal = ref<typeof BuyModal>();
|
||||
@@ -52,7 +53,7 @@ const view = () => {
|
||||
}
|
||||
|
||||
router.push({
|
||||
name: 'market-types',
|
||||
name: routeNames.marketTypes,
|
||||
params: {
|
||||
type: inputItem.value.id
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import {useDebounceFn} from "@vueuse/core";
|
||||
import log from "loglevel";
|
||||
import {activityTypes, RuleInput, Rules, useRuleBooksStore} from "@/rules";
|
||||
import {PlusIcon, TrashIcon} from "@heroicons/vue/24/outline";
|
||||
import {routeNames} from "@/routes";
|
||||
|
||||
const ruleBookId = ref<string>();
|
||||
const name = ref<string>('');
|
||||
@@ -21,7 +22,7 @@ const save = async () => {
|
||||
ledgerRefs: ledgerRefs.value,
|
||||
rules: rules.value
|
||||
})
|
||||
await router.push({ name: 'edit-rule-book', params: {ruleBookId: created.ruleBookId}})
|
||||
await router.push({ name: routeNames.editRuleBook, params: {ruleBookId: created.ruleBookId}})
|
||||
|
||||
} else {
|
||||
await update(ruleBookId.value, {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import {storeToRefs} from "pinia";
|
||||
import {CharacterLabel, useCharactersStore} from "@/characters";
|
||||
import {PencilSquareIcon} from "@heroicons/vue/24/outline";
|
||||
import {routeNames} from "@/routes";
|
||||
|
||||
const {characters} = storeToRefs(useCharactersStore());
|
||||
|
||||
@@ -11,7 +12,7 @@ const {characters} = storeToRefs(useCharactersStore());
|
||||
<div class="grid mb-2 mt-4">
|
||||
<div v-for="character in characters" :key="character.characterId" class="flex items-center mb-2">
|
||||
<CharacterLabel class="flex grow" :character="character" />
|
||||
<RouterLink class="btn-icon ms-2" :to="{ name: 'character-rulebook', params: { characterId: character.characterId } }"><PencilSquareIcon /></RouterLink>
|
||||
<RouterLink class="btn-icon ms-2" :to="{ name: routeNames.characterRulebook, params: { characterId: character.characterId } }"><PencilSquareIcon /></RouterLink>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -2,6 +2,7 @@
|
||||
import {storeToRefs} from "pinia";
|
||||
import {PencilSquareIcon, TrashIcon} from "@heroicons/vue/24/outline";
|
||||
import {useRuleBooksStore} from "@/rules";
|
||||
import {routeNames} from "@/routes";
|
||||
|
||||
const {ruleBooks} = storeToRefs(useRuleBooksStore());
|
||||
|
||||
@@ -10,11 +11,11 @@ const {ruleBooks} = storeToRefs(useRuleBooksStore());
|
||||
<template>
|
||||
<div class="grid mb-2 mt-4">
|
||||
<div class="flex justify-end border-b-1">
|
||||
<RouterLink class="button mb-2 ms-2" :to="{ name: 'new-rule-book'}">New Rule Book</RouterLink>
|
||||
<RouterLink class="button mb-2 ms-2" :to="{ name: routeNames.newRuleBook}">New Rule Book</RouterLink>
|
||||
</div>
|
||||
<div v-for="ruleBook in ruleBooks" :key="ruleBook.ruleBookId" class="flex items-center mt-2">
|
||||
<span class="flex grow me-2">{{ruleBook.name}}</span>
|
||||
<RouterLink class="btn-icon me-1" :to="{ name: 'edit-rule-book', params: { ruleBookId: ruleBook.ruleBookId } }"><PencilSquareIcon /></RouterLink>
|
||||
<RouterLink class="btn-icon me-1" :to="{ name: routeNames.editRuleBook, params: { ruleBookId: ruleBook.ruleBookId } }"><PencilSquareIcon /></RouterLink>
|
||||
<button class="btn-icon"><TrashIcon /></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user