Skip to content

Commit

Permalink
docs(Api): allow manual designation of api page
Browse files Browse the repository at this point in the history
fixes missing prop definitions for grid-lists
  • Loading branch information
johnleider committed Jan 17, 2019
1 parent 423761d commit 2f96d33
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
9 changes: 7 additions & 2 deletions packages/docs/src/components/doc/Api.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<doc-heading>Generic.Pages.api</doc-heading>
<v-card>
<v-tabs
:slider-color="computedTabs.length ? 'primary' : 'transparent'"
v-model="tab"
:slider-color="computedTabs.length ? 'primary' : 'transparent'"
color="grey lighten-3"
>
<v-tab
Expand All @@ -23,8 +23,8 @@
sm4
>
<v-select
:items="value"
v-model="current"
:items="value"
:disabled="value.length < 2"
hide-details
single-line
Expand Down Expand Up @@ -59,6 +59,7 @@
<doc-parameters
:headers="headers[tab]"
:items="component[tab]"
:lang="lang"
:search="search"
:target="current"
:type="tab"
Expand Down Expand Up @@ -91,6 +92,10 @@
export default {
props: {
lang: {
type: String,
default: ''
},
value: {
type: Array,
default: () => ([])
Expand Down
14 changes: 11 additions & 3 deletions packages/docs/src/components/doc/Parameters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<v-layout wrap px-2 py-1>
<v-flex
v-for="(header, i) in headers"
:class="header.class"
:key="header.value"
:class="header.class"
>
<div
class="header grey--text text--darken-2"
Expand Down Expand Up @@ -67,12 +67,14 @@
/>
</v-flex>
<v-flex>
<!-- eslint-disable -->
<doc-markup
v-if="item.example"
class="mt-2 mb-0"
lang="ts"
value="example"
>{{ genTypescriptDef(item.example) }}</doc-markup>
<!-- eslint-enable -->
</v-flex>
</v-layout>
</v-flex>
Expand Down Expand Up @@ -102,6 +104,10 @@
type: Array,
default: () => ([])
},
lang: {
type: String,
default: ''
},
items: {
type: Array,
default: () => ([])
Expand Down Expand Up @@ -195,11 +201,13 @@
str.indexOf('Components.') > -1
)
},
/* eslint-disable max-statements */
genDescription (name, item) {
let description = ''
let devPrepend = ''
const camelSource = this.parseSource(item.source)
const composite = `${this.namespace}.${this.page}`
const page = this.lang ? upperFirst(camelCase(this.lang)) : this.page
const composite = `${this.namespace}.${page}`
// Components.Alerts.props['v-alert'].value
const specialDesc = `${composite}.${this.type}['${this.target}']['${name}']`
Expand Down Expand Up @@ -245,7 +253,7 @@
if (item.signature) return name
name = name || ''
name = name.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`)
name = name.replace(/([A-Z])/g, g => `-${g[0].toLowerCase()}`)
const sync = (item.sync && '.sync') || ''
return `${name}${sync}`
Expand Down
1 change: 1 addition & 0 deletions packages/docs/src/data/pages/framework/GridLists.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"children": [
{
"type": "api",
"lang": "grid",
"value": [
"v-container",
"v-layout",
Expand Down

0 comments on commit 2f96d33

Please sign in to comment.