Skip to content

Commit c66541d

Browse files
committed
2 parents 8108c40 + ed8c610 commit c66541d

File tree

7 files changed

+121
-13
lines changed

7 files changed

+121
-13
lines changed

build/logo.png

-6.69 KB
Binary file not shown.

src/components/Header.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<header>
3-
<router-link class="goback"></router-link>
3+
<!-- <router-link to= class="goback"></router-link> -->
44
<div class="header-content">
55
<slot></slot>
66
</div>

src/page/note/myNote.vue

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<template>
2+
<div id="myNote">
3+
我的纸条
4+
</div>
5+
</template>
6+
<script>
7+
export default {
8+
name: 'myNote',
9+
data () {
10+
return {}
11+
}
12+
}
13+
</script>

src/page/note/noteCommunity.vue

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<template>
2+
<div id="noteCommunity">
3+
纸条社区
4+
</div>
5+
</template>
6+
<script>
7+
export default {
8+
name: 'noteCommunity',
9+
data () {
10+
return {}
11+
}
12+
}
13+
</script>

src/page/note/noteIndex.vue

+58-10
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
<template>
22
<div>
3-
<myheader>
4-
<div class="tab-nav">
5-
<a>纸条</a>
6-
<a>作业</a>
7-
</div>
3+
<myheader class="header">
4+
<div class="tab-nav">
5+
<span @click="tabNavActive = !tabNavActive" class="tab-nav-item" :class="tabNavActive?'active':''">纸条</span>
6+
<span @click="tabNavActive = !tabNavActive" class="tab-nav-item" :class="!tabNavActive?'active':''">作业</span>
7+
</div>
88
</myheader>
99
<div class="tab-content">
10-
<div>
11-
<div>
12-
<router-link>纸条社区</router-link>
10+
<div v-if="tabNavActive">
11+
<div id="tab-btn">
12+
<router-link to="community">纸条社区</router-link>
13+
<router-link to="myNote">我的纸条</router-link>
14+
<router-link to="writeNote">去贴纸条</router-link>
1315
</div>
1416
<router-view></router-view>
1517
</div>
16-
<div></div>
18+
<div v-if="!tabNavActive">
19+
作业
20+
</div>
1721
</div>
1822

1923
<foot-bottom :active=1></foot-bottom>
@@ -24,10 +28,54 @@ import footBottom from '@/components/Footer'
2428
import myheader from '@/components/Header'
2529
export default {
2630
data () {
27-
return {}
31+
return {
32+
tabNavActive: true
33+
}
2834
},
2935
components: {
3036
footBottom, myheader
3137
}
3238
}
3339
</script>
40+
<style scoped lang="scss">
41+
@import '../../style/variable.scss';
42+
.header {
43+
.tab-nav {
44+
.tab-nav-item{
45+
padding: 5px 40px;
46+
background-color: $green;
47+
border-radius: 5px;
48+
border: 1px solid #ffffff;
49+
color: #ffffff;
50+
margin-left: -11px;
51+
&:first-child{
52+
border-top-right-radius: 0;
53+
border-bottom-right-radius: 0;
54+
}
55+
&:last-child{
56+
border-top-left-radius: 0;
57+
border-bottom-left-radius: 0;
58+
}
59+
}
60+
.active{
61+
background-color: #ffffff;
62+
color: $green;
63+
}
64+
}
65+
}
66+
.tab-content{
67+
#tab-btn{
68+
display: flex;
69+
a{
70+
flex: 1;
71+
text-align: center;
72+
padding: 10px;
73+
border-bottom: 4px solid $backgroundColor;
74+
}
75+
.router-link-active{
76+
color: $orange;
77+
border-bottom-color: $orange;
78+
}
79+
}
80+
}
81+
</style>

src/page/note/writeNote.vue

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<template>
2+
<div id="writeNote">
3+
去贴纸条
4+
</div>
5+
</template>
6+
<script>
7+
export default {
8+
name: 'writeNote',
9+
data () {
10+
return {}
11+
}
12+
}
13+
</script>

src/router/pages/webHome.js

+23-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ const home = r => require.ensure([], () => r(require('@/page/home/Home')), 'home
22
const lesson = r => require.ensure([], () => r(require('@/page/home/Lesson')), 'lesson')
33
const noteIndex = r => require.ensure([], () => r(require('@/page/note/noteIndex')), 'noteIndex')
44
const lessonTable = r => require.ensure([], () => r(require('@/page/lessontable/Lessontable')), 'lessonTable')
5-
5+
const noteCommunity = r => require.ensure([], () => r(require('@/page/note/noteCommunity')), 'noteCommunity')
6+
const myNote = r => require.ensure([], () => r(require('@/page/note/myNote')), 'myNote')
7+
const writeNote = r => require.ensure([], () => r(require('@/page/note/writeNote')), 'writeNote')
8+
// writeNote
69
export default {
710
routes: [
811
{
@@ -19,7 +22,25 @@ export default {
1922
},
2023
{
2124
path: '/noteIndex',
22-
component: noteIndex
25+
component: noteIndex,
26+
children: [
27+
{
28+
path: '',
29+
redirect: 'community'
30+
},
31+
{
32+
path: 'community',
33+
component: noteCommunity
34+
},
35+
{
36+
path: 'myNote',
37+
component: myNote
38+
},
39+
{
40+
path: 'writeNote',
41+
component: writeNote
42+
}
43+
]
2344
},
2445
{
2546
path: '/lessonTable',

0 commit comments

Comments
 (0)