Router test OK
This commit is contained in:
parent
706bd07f0b
commit
eaca6cedd2
4 changed files with 84 additions and 2 deletions
11
app.vue
11
app.vue
|
|
@ -1,6 +1,13 @@
|
|||
<template>
|
||||
<div class="app-component">
|
||||
<RangesShow :data-json="data" @selected="itemClicked($event.item)" />
|
||||
<NuxtLink to="/">
|
||||
Home
|
||||
</NuxtLink>
|
||||
<NuxtLink to="/ranges">
|
||||
Ranges
|
||||
</NuxtLink>
|
||||
<NuxtPage :page-key="(route: RouteLocation) => route.fullPath" />
|
||||
<!-- <RangesShow :data-json="data" @selected="itemClicked($event.item)" />
|
||||
<ProductModal
|
||||
v-if="selectedItem"
|
||||
:id="modalId"
|
||||
|
|
@ -8,7 +15,7 @@
|
|||
:settings="data.modalSettings"
|
||||
@saved="SaveContact"
|
||||
/>
|
||||
<AdministrativeModal :id="adminModalId" :contacts="contacts" />
|
||||
<AdministrativeModal :id="adminModalId" :contacts="contacts" /> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
17
pages/index.vue
Normal file
17
pages/index.vue
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<template>
|
||||
<div class="page-home">
|
||||
<h1>Home</h1>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
|
||||
export default defineComponent({
|
||||
name: "HomePage",
|
||||
props: {
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
});
|
||||
</script>
|
||||
29
pages/ranges/[slug].vue
Normal file
29
pages/ranges/[slug].vue
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<template>
|
||||
<div class="page-ranges-index">
|
||||
<h1>Range {{ router.params.slug }}</h1>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
import { useRoute, type RouteLocationNormalizedLoaded } from "vue-router";
|
||||
|
||||
export default defineComponent({
|
||||
name: "RangesIndex",
|
||||
props: {
|
||||
},
|
||||
data(): {
|
||||
router: RouteLocationNormalizedLoaded
|
||||
} {
|
||||
return {
|
||||
router: useRoute()
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
const route = useRoute();
|
||||
console.log(route);
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
});
|
||||
</script>
|
||||
29
pages/ranges/index.vue
Normal file
29
pages/ranges/index.vue
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<template>
|
||||
<div class="page-ranges-index">
|
||||
<h1>RangesIndex</h1>
|
||||
<NuxtLink to="/ranges/charcuterie">
|
||||
charcuterie
|
||||
</NuxtLink>
|
||||
<br>
|
||||
<NuxtLink to="/ranges/panés">
|
||||
panés
|
||||
</NuxtLink>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
export default defineComponent({
|
||||
name: "RangesIndex",
|
||||
props: {
|
||||
},
|
||||
mounted() {
|
||||
const route = useRoute();
|
||||
console.log(route);
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
});
|
||||
</script>
|
||||
Loading…
Add table
Reference in a new issue