Skip to content

Commit

Permalink
refactor: modify routing components
Browse files Browse the repository at this point in the history
  • Loading branch information
hq001 committed Dec 1, 2020
1 parent 5e31b49 commit 3968e85
Show file tree
Hide file tree
Showing 24 changed files with 74 additions and 62 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ yarn
| 功能 | browser | electron | mobile |
| :-------------------------------------------------------------- | :-----: | :------: | :----: |
| 登录支持,邮箱、手机号 ||| |
| 歌手搜索、专辑列表 | | | |
| 排行榜(歌单、歌手) | | | |
| 朋友动态查看、点赞等 | | | |
| 视频播放、收藏 | | | |
| 歌单列表、全部播放、收藏、添加待播放队列 | | | |
Expand Down
1 change: 1 addition & 0 deletions src/pages/cloud/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Cloud } from './view/index'
Empty file added src/pages/cloud/module.ts
Empty file.
Empty file added src/pages/cloud/sage.ts
Empty file.
Empty file added src/pages/cloud/state.ts
Empty file.
12 changes: 12 additions & 0 deletions src/pages/cloud/view/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineComponent } from 'vue'

export const Cloud = defineComponent({
name: 'Cloud',
render() {
return (
<div class="cloud">
<h1>下载管理</h1>
</div>
)
}
})
1 change: 1 addition & 0 deletions src/pages/download/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Download } from './view/index'
Empty file added src/pages/download/module.ts
Empty file.
Empty file added src/pages/download/sage.ts
Empty file.
Empty file added src/pages/download/state.ts
Empty file.
12 changes: 12 additions & 0 deletions src/pages/download/view/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineComponent } from 'vue'

export const Download = defineComponent({
name: 'Download',
render() {
return (
<div class="download">
<h1>下载管理</h1>
</div>
)
}
})
1 change: 1 addition & 0 deletions src/pages/moments/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Moments } from './view/index'
Empty file added src/pages/moments/module.ts
Empty file.
Empty file added src/pages/moments/sage.ts
Empty file.
Empty file added src/pages/moments/state.ts
Empty file.
12 changes: 12 additions & 0 deletions src/pages/moments/view/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineComponent } from 'vue'

export const Moments = defineComponent({
name: 'Moments',
render() {
return (
<div class="moments">
<h1>动态</h1>
</div>
)
}
})
1 change: 1 addition & 0 deletions src/pages/music/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { LocalMusic } from './view/index'
Empty file added src/pages/music/module.ts
Empty file.
Empty file added src/pages/music/sage.ts
Empty file.
Empty file added src/pages/music/state.ts
Empty file.
12 changes: 12 additions & 0 deletions src/pages/music/view/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineComponent } from 'vue'

export const LocalMusic = defineComponent({
name: 'LocalMusic',
render() {
return (
<div class="local-music">
<h1>本地音乐</h1>
</div>
)
}
})
2 changes: 1 addition & 1 deletion src/pages/video/children/mv/view/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const Mv = defineComponent({
render() {
return (
<div class="video-mv">
<router-view></router-view>
<h1>MV</h1>
</div>
)
}
Expand Down
1 change: 0 additions & 1 deletion src/pages/video/view/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { defineComponent } from 'vue'
export { Mv } from '../children/mv/view/index'

export const Video = defineComponent({
name: 'Video',
Expand Down
79 changes: 19 additions & 60 deletions src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import { $404 } from '@/pages/404/view/index'
import { FindMusic, Recommend, SongList } from '@/pages/news/index'
import { Video, Mv } from '@/pages/video/index'
import { Profile } from './../pages/auth/views/profile'
import { Moments } from '@/pages/moments/index'
import { LocalMusic } from '@/pages/music/index'
import { Download } from '@/pages/download/index'
import { Cloud } from '@/pages/cloud/index'
import { Platform } from '@/config/build'

const { VUE_APP_PLATFORM } = process.env
Expand Down Expand Up @@ -118,79 +122,34 @@ export const navRouter: RouteRecordRaw[] = [
]
},
{
path: '/friend',
component: FindMusic,
path: '/moments',
component: Moments,
meta: {
name: '朋友'
},
children: [
{
path: '',
redirect: '/friend/dynamic'
},
{
path: '/friend/dynamic',
component: Recommend,
meta: {
name: '动态'
}
}
]
}
},
{
path: '/local-music',
component: FindMusic,
component: LocalMusic,
meta: {
name: '本地音乐',
beforeHeader: '我的音乐'
},
children: [
{
path: '',
redirect: '/local-music/song'
},
{
path: '/local-music/song',
component: Recommend,
meta: {
name: '歌曲'
}
},
{
path: '/local-music/singer',
component: Recommend,
meta: {
name: '歌手'
}
}
]
}
},
{
path: '/download-manage',
component: FindMusic,
component: Download,
meta: {
name: '下载管理'
},
children: [
{
path: '',
redirect: '/download-manage/single'
},
{
path: '/download-manage/single',
component: Recommend,
meta: {
name: '已下载单曲'
}
},
{
path: '/download-manage/mv',
component: Recommend,
meta: {
name: '已下载MV'
}
}
]
}
},
{
path: '/cloud',
component: Cloud,
meta: {
name: '我的音乐云盘',
auth: true
}
}
]

Expand Down

0 comments on commit 3968e85

Please sign in to comment.