Skip to content

Commit 09ac332

Browse files
committed
feat: add Introduction
1 parent 0eb237e commit 09ac332

File tree

3 files changed

+43
-10
lines changed

3 files changed

+43
-10
lines changed

src/components/Introduction.vue

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<template>
2+
<div>
3+
<h2>Introduction</h2>
4+
<a href="https://vuetifyjs.com/en/introduction/why-vuetify/">why-vuetify</a><br>
5+
<a href="https://vuejs.org/index.html">why vue.js</a><br>
6+
<a href="https://d3js.org/">why d3.js</a>
7+
</div>
8+
</template>
9+
<script>
10+
export default {
11+
data () {
12+
return {}
13+
},
14+
mounted () {
15+
console.log('Introduction')
16+
}
17+
}
18+
</script>
19+
<style scoped>
20+
</style>

src/router.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ const router = new Router({
2525
component: () => import('./views/Examples.vue'),
2626
meta: { title: 'Examples' },
2727
children: [
28+
{
29+
path: '/examples/introduction',
30+
name: 'introduction',
31+
component: () => import('./components/Introduction.vue'),
32+
meta: { title: 'Introduction' }
33+
},
2834
{
2935
path: '/examples/helloworld',
3036
name: 'helloworld',

src/views/Examples.vue

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
import packageJson from '../../package.json'
118118
export default {
119119
data: () => ({
120-
version: 'v0.1.0',
120+
version: '',
121121
dialog: false,
122122
dark: false,
123123
drawer: null,
@@ -128,13 +128,13 @@ export default {
128128
computed: {
129129
items: function () {
130130
return [
131-
// {
132-
// icon: 'mdi-alpha-b-box-outline',
133-
// title: 'Introduction',
134-
// path: '/examples/introduction',
135-
// appendIcon: null,
136-
// active: true
137-
// },
131+
{
132+
icon: 'mdi-alpha-i-box-outline',
133+
title: 'Introduction',
134+
path: '/examples/introduction',
135+
appendIcon: null,
136+
active: true
137+
},
138138
{
139139
icon: 'mdi-alpha-b-box-outline',
140140
title: this.$vuetify.lang.t('$vuetify.sidebar.title1.value'),
@@ -145,8 +145,9 @@ export default {
145145
{ title: this.$vuetify.lang.t('$vuetify.sidebar.title1.children.title4.value'), path: '/examples/selectelementbinddata' },
146146
{ title: this.$vuetify.lang.t('$vuetify.sidebar.title1.children.title5.value'), path: '/examples/selectinsertremove' }
147147
],
148-
appendIcon: 'mdi-chevron-down',
149-
active: true
148+
appendIcon: 'mdi-chevron-down'
149+
// ,
150+
// active: true
150151
},
151152
{
152153
icon: 'mdi-alpha-t-box-outline',
@@ -218,6 +219,8 @@ export default {
218219
this.dark = true
219220
}
220221
if (this.$route.path === '/examples') {
222+
// this.$router.push('/examples/helloworld').catch(err => { }) // eslint-disable-line
223+
// default route path
221224
this.$router.push('/examples/helloworld').catch(err => { }) // eslint-disable-line
222225
} else {
223226
this.$router.push(this.$route.path).catch(err => { }) // eslint-disable-line
@@ -300,6 +303,10 @@ export default {
300303
itemClick (item, key) {
301304
this.subItemActive = null
302305
sessionStorage.setItem('itemActive', key)
306+
console.dir(item)
307+
if (!item.children) {
308+
this.$router.push(item.path).catch(err => { }) // eslint-disable-line
309+
}
303310
},
304311
subItemClick (item, key) {
305312
sessionStorage.setItem('subItemActive', key)

0 commit comments

Comments
 (0)