Skip to content

Commit 8b05d4d

Browse files
committed
fix #62: add view code link to each page
1 parent a4d5c5c commit 8b05d4d

File tree

6 files changed

+96
-27
lines changed

6 files changed

+96
-27
lines changed

client/components/layout/Levelbar.vue

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@
66
<strong>{{ name }}</strong>
77
</h3>
88
</div>
9+
<div class="level-item" v-if="!!codelink">
10+
<tooltip label="View code" placement="right" size="small" :rounded="true">
11+
<span class="icon">
12+
<a :href="codelink">
13+
<i class="fa fa-github"></i>
14+
</a>
15+
</span>
16+
</tooltip>
17+
</div>
918
</div>
1019

1120
<div class="level-right is-hidden-mobile">
@@ -16,10 +25,12 @@
1625

1726
<script>
1827
import Breadcrumb from 'vue-bulma-breadcrumb'
28+
import Tooltip from 'vue-bulma-tooltip'
1929
2030
export default {
2131
components: {
22-
Breadcrumb
32+
Breadcrumb,
33+
Tooltip
2334
},
2435
2536
data () {
@@ -33,6 +44,13 @@ export default {
3344
},
3445
3546
computed: {
47+
codelink () {
48+
if (this.$route.meta && this.$route.meta.link) {
49+
return 'https://github.com/vue-bulma/vue-admin/blob/master/client/views/' + this.$route.meta.link
50+
} else {
51+
return null
52+
}
53+
},
3654
name () {
3755
return this.$route.name
3856
}

client/store/modules/menu/charts.js

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,43 @@ export default {
55
path: '/charts',
66
meta: {
77
icon: 'fa-bar-chart-o',
8-
expanded: false
8+
expanded: false,
9+
link: 'charts/index.vue'
910
},
1011
component: lazyLoading('charts', true),
1112

1213
children: [
1314
{
1415
name: 'Chartist',
1516
path: 'chartist',
16-
component: lazyLoading('charts/Chartist')
17+
component: lazyLoading('charts/Chartist'),
18+
meta: {
19+
link: 'charts/Chartist.vue'
20+
}
1721
},
1822
{
1923
name: 'Chartjs',
2024
path: 'chartjs',
21-
component: lazyLoading('charts/Chartjs')
25+
component: lazyLoading('charts/Chartjs'),
26+
meta: {
27+
link: 'charts/Chartjs.vue'
28+
}
2229
},
2330
{
2431
name: 'Peity',
2532
path: 'peity',
26-
component: lazyLoading('charts/Peity')
33+
component: lazyLoading('charts/Peity'),
34+
meta: {
35+
link: 'charts/Peity.vue'
36+
}
2737
},
2838
{
2939
name: 'Plotly',
3040
path: 'plotly',
31-
component: lazyLoading('charts/Plotly')
41+
component: lazyLoading('charts/Plotly'),
42+
meta: {
43+
link: 'charts/Plotly.vue'
44+
}
3245
}
3346
]
3447
}

client/store/modules/menu/components.js

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@ export default {
1313
{
1414
name: 'Components',
1515
path: '',
16-
component: lazyLoading('components/Default')
16+
component: lazyLoading('components/Default'),
17+
meta: {
18+
link: 'components/Default.vue'
19+
}
1720
},
1821
{
1922
name: 'BackToTop',
2023
path: 'backToTop',
2124
meta: {
2225
description: 'Jump component is based on jump.js',
23-
repository: 'https://github.com/vue-bulma/jump'
26+
repository: 'https://github.com/vue-bulma/jump',
27+
link: 'components/BackToTop.vue'
2428
},
2529
component: lazyLoading('components/BackToTop')
2630
},
@@ -29,7 +33,8 @@ export default {
2933
path: 'brace',
3034
meta: {
3135
description: 'Code editor component that based on brace',
32-
repository: 'https://github.com/vue-bulma/brace'
36+
repository: 'https://github.com/vue-bulma/brace',
37+
link: 'components/Brace.vue'
3338
},
3439
component: lazyLoading('components/Brace')
3540
},
@@ -38,7 +43,8 @@ export default {
3843
path: 'collapse',
3944
meta: {
4045
description: 'Collapse component',
41-
repository: 'https://github.com/vue-bulma/collapse'
46+
repository: 'https://github.com/vue-bulma/collapse',
47+
link: 'components/Collapse.vue'
4248
},
4349
component: lazyLoading('components/Collapse')
4450
},
@@ -47,7 +53,8 @@ export default {
4753
path: 'datepicker',
4854
meta: {
4955
description: 'Datepicker component is based on flatpickr',
50-
repository: 'https://github.com/vue-bulma/datepicker'
56+
repository: 'https://github.com/vue-bulma/datepicker',
57+
link: 'components/Datepicker.vue'
5158
},
5259
component: lazyLoading('components/Datepicker')
5360
},
@@ -56,7 +63,8 @@ export default {
5663
path: 'emoji',
5764
meta: {
5865
description: 'Emoji Component is based on emojione.com',
59-
repository: 'https://github.com/vue-bulma/emoji'
66+
repository: 'https://github.com/vue-bulma/emoji',
67+
link: 'components/Emoji.vue'
6068
},
6169
component: lazyLoading('components/Emoji')
6270
},
@@ -65,7 +73,8 @@ export default {
6573
path: 'message',
6674
meta: {
6775
description: 'Message component',
68-
repository: 'https://github.com/vue-bulma/message'
76+
repository: 'https://github.com/vue-bulma/message',
77+
link: 'components/Message.vue'
6978
},
7079
component: lazyLoading('components/Message')
7180
},
@@ -74,7 +83,8 @@ export default {
7483
path: 'modal',
7584
meta: {
7685
description: 'Modal component',
77-
repository: 'https://github.com/vue-bulma/modal'
86+
repository: 'https://github.com/vue-bulma/modal',
87+
link: 'components/Modal.vue'
7888
},
7989
component: lazyLoading('components/Modal')
8090
},
@@ -83,7 +93,8 @@ export default {
8393
path: 'notification',
8494
meta: {
8595
description: 'Notification component',
86-
repository: 'https://github.com/vue-bulma/notification'
96+
repository: 'https://github.com/vue-bulma/notification',
97+
link: 'components/Notification.vue'
8798
},
8899
component: lazyLoading('components/Notification')
89100
},
@@ -92,7 +103,8 @@ export default {
92103
path: 'progress-bar',
93104
meta: {
94105
description: 'ProgressBar component',
95-
repository: 'https://github.com/vue-bulma/progress-bar'
106+
repository: 'https://github.com/vue-bulma/progress-bar',
107+
link: 'components/ProgressBar.vue'
96108
},
97109
component: lazyLoading('components/ProgressBar')
98110
},
@@ -101,7 +113,8 @@ export default {
101113
path: 'progress-tracker',
102114
meta: {
103115
description: 'ProgressTracker component is based on progress-tracker',
104-
repository: 'https://github.com/vue-bulma/progress-tracker'
116+
repository: 'https://github.com/vue-bulma/progress-tracker',
117+
link: 'components/ProgressTracker.vue'
105118
},
106119
component: lazyLoading('components/ProgressTracker')
107120
},
@@ -110,7 +123,8 @@ export default {
110123
path: 'quill',
111124
meta: {
112125
description: 'Your powerful, rich text editor',
113-
repository: 'https://github.com/vue-bulma/quill'
126+
repository: 'https://github.com/vue-bulma/quill',
127+
link: 'components/Quill.vue'
114128
},
115129
component: lazyLoading('components/Quill')
116130
},
@@ -119,7 +133,8 @@ export default {
119133
path: 'rating',
120134
meta: {
121135
description: 'Rating component is based on starability.css',
122-
repository: 'https://github.com/vue-bulma/rating'
136+
repository: 'https://github.com/vue-bulma/rating',
137+
link: 'components/Rating.vue'
123138
},
124139
component: lazyLoading('components/Rating')
125140
},
@@ -128,7 +143,8 @@ export default {
128143
path: 'slider',
129144
meta: {
130145
description: 'Slider component',
131-
repository: 'https://github.com/vue-bulma/slider'
146+
repository: 'https://github.com/vue-bulma/slider',
147+
link: 'components/Slider.vue'
132148
},
133149
component: lazyLoading('components/Slider')
134150
},
@@ -137,7 +153,8 @@ export default {
137153
path: 'switch',
138154
meta: {
139155
description: 'Switch component',
140-
repository: 'https://github.com/vue-bulma/switch'
156+
repository: 'https://github.com/vue-bulma/switch',
157+
link: 'components/Switch.vue'
141158
},
142159
component: lazyLoading('components/Switch')
143160
},
@@ -146,7 +163,8 @@ export default {
146163
path: 'tabs',
147164
meta: {
148165
description: 'Tabs component',
149-
repository: 'https://github.com/vue-bulma/tabs'
166+
repository: 'https://github.com/vue-bulma/tabs',
167+
link: 'components/Tabs.vue'
150168
},
151169
component: lazyLoading('components/Tabs')
152170
},
@@ -155,7 +173,8 @@ export default {
155173
path: 'tooltip',
156174
meta: {
157175
description: 'Tooltip component is based on hint.css',
158-
repository: 'https://github.com/vue-bulma/tooltip'
176+
repository: 'https://github.com/vue-bulma/tooltip',
177+
link: 'components/Tooltip.vue'
159178
},
160179
component: lazyLoading('components/Tooltip')
161180
},
@@ -164,7 +183,8 @@ export default {
164183
path: 'lory',
165184
meta: {
166185
description: 'Slider component is based on lory, lory: ☀ Touch enabled minimalistic slider',
167-
repository: 'https://github.com/vue-bulma/lory'
186+
repository: 'https://github.com/vue-bulma/lory',
187+
link: 'components/Lory.vue'
168188
},
169189
component: lazyLoading('components/Lory')
170190
}

client/store/modules/menu/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,17 @@ const state = {
1515
name: 'Dashboard',
1616
path: '/dashboard',
1717
meta: {
18-
icon: 'fa-tachometer'
18+
icon: 'fa-tachometer',
19+
link: 'dashboard/index.vue'
1920
},
2021
component: lazyLoading('dashboard', true)
2122
},
2223
{
2324
name: 'Axios',
2425
path: '/axiosDemo',
2526
meta: {
26-
icon: 'fa-rocket'
27+
icon: 'fa-rocket',
28+
link: 'axios/index.vue'
2729
},
2830
component: lazyLoading('axios', true)
2931
},

client/store/modules/menu/tables.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@ export default {
1212
name: 'BasicTables',
1313
path: '/tables/basic',
1414
meta: {
15-
label: 'Basic Tables'
15+
label: 'Basic Tables',
16+
link: 'tables/Basic.vue'
1617
},
1718
component: lazyLoading('tables/Basic')
1819
},
1920
{
2021
name: 'Handsontable',
2122
path: '/tables/handsontable',
23+
meta: {
24+
link: 'tables/Handsontable.vue'
25+
},
2226
component: lazyLoading('tables/Handsontable')
2327
}
2428
]

client/store/modules/menu/uifeatures.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,33 @@ export default {
1111
{
1212
name: 'Buttons',
1313
path: '/buttons',
14+
meta: {
15+
link: 'ui/Buttons.vue'
16+
},
1417
component: lazyLoading('ui/Buttons')
1518
},
1619
{
1720
name: 'Form',
1821
path: '/form',
22+
meta: {
23+
link: 'ui/Form.vue'
24+
},
1925
component: lazyLoading('ui/Form')
2026
},
2127
{
2228
name: 'Typography',
2329
path: '/typography',
30+
meta: {
31+
link: 'ui/Typography.vue'
32+
},
2433
component: lazyLoading('ui/Typography')
2534
},
2635
{
2736
name: 'Icons',
2837
path: '/icons',
38+
meta: {
39+
link: 'ui/Icons.vue'
40+
},
2941
component: lazyLoading('ui/Icons')
3042
}
3143
]

0 commit comments

Comments
 (0)