Skip to content

Commit c7d7330

Browse files
authored
Merge pull request #353 from telerik/add-nuxt3
Add nuxt3
2 parents 17f8ab7 + 05fe4b8 commit c7d7330

File tree

394 files changed

+103997
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

394 files changed

+103997
-0
lines changed

.DS_Store

8 KB
Binary file not shown.

kendo-nuxt3/.DS_Store

6 KB
Binary file not shown.

kendo-nuxt3/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules
2+
*.log*
3+
.nuxt
4+
.nitro
5+
.cache
6+
.output
7+
.env
8+
dist

kendo-nuxt3/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Nuxt 3 Minimal Starter
2+
3+
Look at the [nuxt 3 documentation](https://v3.nuxtjs.org) to learn more.
4+
5+
## Setup
6+
7+
Make sure to install the dependencies:
8+
9+
```bash
10+
# yarn
11+
yarn install
12+
13+
# npm
14+
npm install
15+
16+
# pnpm
17+
pnpm install --shamefully-hoist
18+
```
19+
20+
## Development Server
21+
22+
Start the development server on http://localhost:3000
23+
24+
```bash
25+
npm run dev
26+
```
27+
28+
## Production
29+
30+
Build the application for production:
31+
32+
```bash
33+
npm run build
34+
```
35+
36+
Locally preview production build:
37+
38+
```bash
39+
npm run preview
40+
```
41+
42+
Checkout the [deployment documentation](https://v3.nuxtjs.org/guide/deploy/presets) for more information.

kendo-nuxt3/app.vue

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<template>
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>
12+
<Drawer
13+
:expanded="expanded"
14+
:position="position"
15+
:mode="mode"
16+
:items="items"
17+
@select="onSelect"
18+
>
19+
<DrawerContent>
20+
<NuxtPage />
21+
</DrawerContent>
22+
</Drawer>
23+
</div>
24+
25+
</template>
26+
<script>
27+
import { Drawer, DrawerContent, AppBar, AppBarSection, AppBarSpacer } from "@progress/kendo-vue-layout";
28+
import { Button } from "@progress/kendo-vue-buttons";
29+
30+
export default {
31+
name: "App",
32+
components: { Drawer, DrawerContent, "kbutton": Button,
33+
AppBar, AppBarSection, AppBarSpacer },
34+
mounted() {
35+
this.$router.push(this.items[0].data);
36+
},
37+
computed: {
38+
items() {
39+
const splitName = this.$route.name.split('-')
40+
const currentRootName = splitName[0];
41+
const rootroutes = this.$route.name === 'index'
42+
? this.$router.options.routes
43+
.filter(r=>r.path.split('/').length === 2)
44+
.map(t=>{
45+
return {
46+
text: t.name,
47+
selected: t.name === this.$route.name,
48+
data: {
49+
path: t.path
50+
}
51+
}})
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+
];
72+
return rootroutes;
73+
}
74+
},
75+
data() {
76+
77+
return {
78+
expanded: true,
79+
position: "start",
80+
mode: "push",
81+
};
82+
},
83+
methods: {
84+
onSelect(e) {
85+
this.$router.push(this.items[e.itemIndex].data);
86+
},
87+
handleClick() {
88+
this.expanded = !this.expanded;
89+
},
90+
},
91+
};
92+
</script>

kendo-nuxt3/components/Navigation.vue

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<template>
2+
<KButton @click="handleClick"> {{visible ? ' Hide Navigation' : 'Show Navigation' }}</KButton>
3+
4+
</template>
5+
6+
<script lang="ts">
7+
import { computed } from 'vue';
8+
import { Button } from "@progress/kendo-vue-buttons";
9+
10+
export default {
11+
components: {
12+
KButton: Button
13+
},
14+
provide(this: any) {
15+
return {
16+
visible: computed(() => this.visible)
17+
}
18+
},
19+
data() {
20+
return {
21+
visible: true
22+
};
23+
},
24+
methods: {
25+
handleClick(this: any) {
26+
this.visible = !this.visible;
27+
}
28+
}
29+
}
30+
</script>

kendo-nuxt3/nuxt.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// https://v3.nuxtjs.org/api/configuration/nuxt.config
2+
export default defineNuxtConfig({
3+
css: [
4+
'@progress/kendo-theme-default/dist/all.css',
5+
],
6+
pages:true
7+
})

0 commit comments

Comments
 (0)