forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetListingComponent.js
More file actions
50 lines (41 loc) · 1.01 KB
/
getListingComponent.js
File metadata and controls
50 lines (41 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { QIcon } from 'quasar'
import { farFileAlt, fasFolderOpen } from '@quasar/extras/fontawesome-v5'
import DocPage from './DocPage.vue'
import DocLink from './DocLink.vue'
import getMeta from 'assets/get-meta.js'
export default function (title, links) {
return {
name: 'DocListingPage',
meta: {
title: `${title} listing`,
meta: getMeta(
`${title} | Quasar Framework`,
`List of pages under the '${title}' section`
)
},
preFetch ({ store }) {
store.commit('updateToc', [])
},
render (h) {
return h(DocPage, {
props: {
title,
noEdit: true
}
}, links.map(link => {
return h('div', { staticClass: 'doc-page-listing' }, [
h(QIcon, {
props: {
name: link.page === true ? farFileAlt : fasFolderOpen
}
}),
h(DocLink, {
props: {
to: link.to
}
}, [ link.title ])
])
}))
}
}
}