Skip to content

Commit 05fe4b8

Browse files
committed
chore: update nuxt 3 routes and index page
1 parent 91c0464 commit 05fe4b8

File tree

2 files changed

+37
-91
lines changed

2 files changed

+37
-91
lines changed

kendo-nuxt3/app.vue

+33-17
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
<template>
2-
<div>
3-
<div class="custom-toolbar">
4-
<kbutton :icon="'menu'" :fill-mode="'flat'" @click="handleClick" />
5-
<NuxtLink to="/">Home</NuxtLink>
6-
</div>
2+
<div>
3+
<AppBar>
4+
<AppBarSection>
5+
<kbutton :icon="'menu'" :fill-mode="'flat'" @click="handleClick" />
6+
</AppBarSection>
7+
<AppBarSpacer :width="4" />
8+
<AppBarSection>
9+
<NuxtLink to="/">Home</NuxtLink>
10+
</AppBarSection>
11+
</AppBar>
712
<Drawer
813
:expanded="expanded"
914
:position="position"
@@ -19,12 +24,13 @@
1924

2025
</template>
2126
<script>
22-
import { Drawer, DrawerContent } from "@progress/kendo-vue-layout";
27+
import { Drawer, DrawerContent, AppBar, AppBarSection, AppBarSpacer } from "@progress/kendo-vue-layout";
2328
import { Button } from "@progress/kendo-vue-buttons";
2429
2530
export default {
2631
name: "App",
27-
components: { Drawer, DrawerContent, "kbutton": Button },
32+
components: { Drawer, DrawerContent, "kbutton": Button,
33+
AppBar, AppBarSection, AppBarSpacer },
2834
mounted() {
2935
this.$router.push(this.items[0].data);
3036
},
@@ -43,16 +49,26 @@ export default {
4349
path: t.path
4450
}
4551
}})
46-
: this.$router.options.routes
47-
.filter(r=>r.path.startsWith('/' + currentRootName))
48-
.map(t=>{
49-
return {
50-
text: t.name,
51-
selected: t.name === this.$route.name,
52-
data: {
53-
path: t.path
54-
}
55-
}});
52+
: [
53+
{
54+
text: 'Go Back',
55+
data: {
56+
path: '/'
57+
}
58+
},
59+
...this.$router.options.routes
60+
.filter(r=> {
61+
return r.path.startsWith('/' + currentRootName) && r.path.endsWith('main')
62+
})
63+
.map(t=>{
64+
return {
65+
text: t.name.split('-main')[0],
66+
selected: t.name === this.$route.name,
67+
data: {
68+
path: t.path
69+
}
70+
}})
71+
];
5672
return rootroutes;
5773
}
5874
},

kendo-nuxt3/pages/index.vue

+4-74
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,10 @@
11
<template>
2-
<div class="example-wrapper">
3-
<div>
4-
<div>Favorite sports:</div>
5-
6-
<dropdownlist
7-
aria-label="Select a Customer"
8-
:fill-mode="'outline'"
9-
:data-items="allData"
10-
:text-field="'text'"
11-
:data-item-key="'id'"
12-
:defaultValue="customerInfo"
13-
:filterable="true"
14-
:popup-settings="{
15-
height: '250px',
16-
}"
17-
@scroll="handleScroll"
18-
/>
19-
<br />
20-
<br />
21-
<br />
22-
<br />
23-
<combobox
24-
aria-label="Select a Customer"
25-
:fill-mode="'outline'"
26-
:data-items="allData"
27-
:text-field="'text'"
28-
:data-item-key="'id'"
29-
:defaultValue="customerInfo"
30-
:filterable="true"
31-
:popup-settings="{
32-
height: '250px',
33-
}"
34-
@scroll="handleScroll"
35-
/>
36-
</div>
37-
</div>
2+
<a href="https://www.telerik.com/kendo-vue-ui/?utm_medium=referral&amp;utm_source=npm&amp;utm_campaign=kendo-ui-vue-trial-npm-utils&amp;utm_content=banner" rel="nofollow">
3+
<img src="https://camo.githubusercontent.com/e1de088440453e2ad64df3f79fdd0c606337b143312846fbec008c2b2ea8c068/68747470733a2f2f7777772e74656c6572696b2e636f6d2f6b656e646f2d7675652d75692f6e706d2d62616e6e65722e737667" alt="Kendo UI for Vue NPM Banner" data-canonical-src="https://www.telerik.com/kendo-vue-ui/npm-banner.svg" style="max-width: 100%;">
4+
</a>
385
</template>
396
<script>
40-
import { MultiSelect, DropDownList, ComboBox } from "@progress/kendo-vue-dropdowns";
41-
427
export default {
43-
components: {
44-
multiselect: MultiSelect,
45-
dropdownlist: DropDownList,
46-
combobox: ComboBox,
47-
},
48-
data: function () {
49-
return {
50-
total: 105,
51-
pageSize: 100,
52-
skip: 0,
53-
take: undefined,
54-
popupSettings: {
55-
height: "250px",
56-
},
57-
customerInfo: { id: 1, text: "Item 1" },
58-
};
59-
},
60-
computed: {
61-
allData() {
62-
const allData = [];
63-
for (let i = 0; i < this.total; i++) {
64-
allData.push({ id: i, text: "Item " + i });
65-
}
66-
return allData;
67-
},
68-
},
69-
methods: {
70-
handleScroll(e) {
71-
if (
72-
e.target.scrollTop + 10 >=
73-
e.target.scrollHeight - e.target.clientHeight
74-
) {
75-
this.total = this.total + 20;
76-
}
77-
},
78-
},
8+
799
};
8010
</script>

0 commit comments

Comments
 (0)