1212 target =" _blank"
1313 href =" https://vuejs.org/v2/guide/render-function.html#Functional-Components"
1414 >
15- Functional Component
15+ Functional component
1616 </b-badge >
1717 </b-col >
1818 <b-col sm =" 3" class =" text-sm-right" >
5757 <li v-if =" rootEventListeners && rootEventListeners.length > 0" >
5858 <a :href =" `#comp-ref-${componentName}-rootEventListeners`" >
5959 <code class =" notranslate" translate =" no" >{{ tag }}</code >
60- <code class =" notranslate" translate =" no" >$root</code > Event Listeners
60+ <code class =" notranslate" translate =" no" >$root</code > Event listeners
6161 </a >
6262 </li >
6363 </ul >
9191 table-class =" bv-docs-table"
9292 responsive =" sm"
9393 sort-icon-left
94+ bordered
9495 striped
9596 >
9697 <template v-slot :cell (prop)="{ value, item }">
97- <code class =" text-nowrap notranslate" translate =" no" >{{ value }}</code >
98+ <code class =" text-nowrap notranslate" translate =" no" >{{ value }}</code >< br >
9899 <b-badge v-if =" item.required" variant =" info" >Required</b-badge >
100+ <b-badge v-if =" item.settings" variant =" dark" >Settings</b-badge >
99101 <b-badge v-if =" item.version" variant =" secondary" >v{{ item.version }}+</b-badge >
100102 <b-badge v-if =" item.isVModel" variant =" primary" >v-model</b-badge >
101103 <b-badge v-if =" item.xss" variant =" warning" >Use with caution</b-badge >
102104 <b-badge v-if =" item.deprecated" variant =" danger" >Deprecated</b-badge >
103105 <b-badge v-else-if =" item.deprecation" variant =" warning" >Deprecation</b-badge >
104106 </template >
107+ <template v-slot :cell (type)="{ value }">
108+ <span v-html =" value" ></span >
109+ </template >
105110 <template v-slot :cell (defaultValue)="{ value }">
106111 <code v-if =" value" class =" word-wrap-normal notranslate" translate =" no" >{{ value }}</code >
107112 </template >
142147
143148 <article v-if =" componentVModel" class =" bd-content" >
144149 <anchored-heading :id =" `comp-ref-${componentName}-v-model`" level =" 4" class =" mb-3" >
145- v-model
150+ < code class = " notranslate " translate = " no " > v-model</ code >
146151 </anchored-heading >
147152 <b-table-lite
148153 :items =" [componentVModel]"
149154 :fields =" [{ key: 'prop', label: 'Property' }, 'event']"
150155 table-class =" bv-docs-table"
151156 responsive =" sm"
157+ bordered
152158 striped
153159 >
154160 <template v-slot :cell (prop)="{ value }">
171177 table-class =" bv-docs-table"
172178 responsive =" sm"
173179 sort-icon-left
180+ bordered
174181 striped
175182 >
176183 <template v-slot :cell (name)="{ value, item }">
197204 primary-key =" prop"
198205 class =" mb-0"
199206 head-variant =" dark"
207+ bordered
200208 striped
201209 small
202210 caption-top
236244 primary-key =" event"
237245 table-class =" bv-docs-table"
238246 responsive =" sm"
247+ bordered
239248 striped
240249 >
241250 <template v-slot :cell (event)="{ value, item }">
257266
258267 <article v-if =" rootEventListeners && rootEventListeners.length > 0" class =" bd-content" >
259268 <anchored-heading :id =" `comp-ref-${componentName}-rootEventListeners`" level =" 4" class =" mb-3" >
260- <code class =" notranslate" translate =" no" >$root</code > Event Listeners
269+ <code class =" notranslate" translate =" no" >$root</code > event listeners
261270 </anchored-heading >
262271 <p >
263272 You can control <code class =" notranslate" translate =" no" >{{ tag }}</code > by emitting the
269278 primary-key =" event"
270279 table-class =" bv-docs-table"
271280 responsive =" sm"
281+ bordered
272282 striped
273283 >
274284 <template v-slot :cell (event)="{ value, item }">
@@ -456,26 +466,22 @@ export default {
456466
457467 // Describe type
458468 let type = p .type
469+ let types = []
459470 if (Array .isArray (type)) {
460- type = type .map (t => t .name ).join (' or ' )
461- } else if (typeof type === ' undefined' ) {
462- type = ' Any'
471+ types = type .map (type => type .name )
463472 } else {
464- type = type .name
473+ types = type && type .name ? [ type . name ] : [ ' Any ' ]
465474 }
475+ type = types
476+ .map (type => ` <code class="notranslate" translate="no">${ type} </code>` )
477+ .join (' or ' )
466478
467479 // Default value
468- let defaultVal = p .default
469- if (defaultVal instanceof Function && ! Array .isArray (defaultVal)) {
470- defaultVal = defaultVal ()
471- }
472- if (typeof defaultVal === ' undefined' || defaultVal === null ) {
473- defaultVal = ' '
474- }
475- defaultVal = JSON .stringify (defaultVal, undefined , 1 ).replace (/ "/ g , " '" )
476- if (defaultVal === " ''" ) {
477- defaultVal = ' '
480+ let defaultValue = p .default
481+ if (defaultValue instanceof Function && ! Array .isArray (defaultValue)) {
482+ defaultValue = defaultValue ()
478483 }
484+ defaultValue = String (JSON .stringify (defaultValue, undefined , 1 )).replace (/ "/ g , " '" )
479485
480486 const fallbackMeta = commonProps[prop] || {}
481487 const description =
@@ -485,9 +491,10 @@ export default {
485491 return {
486492 prop: kebabCase (prop),
487493 type,
488- defaultValue: defaultVal ,
494+ defaultValue,
489495 required: p .required || false ,
490496 description: description || ' ' ,
497+ settings: meta .settings || false ,
491498 version,
492499 xss: / [a-z ] Html$ / .test (prop),
493500 isVModel: this .componentVModel && this .componentVModel .prop === prop,
0 commit comments