🌐 AI搜索 & 代理 主页
Skip to content

Commit ca75259

Browse files
committed
Add "available since" notice based on meta information
1 parent 6727765 commit ca75259

File tree

12 files changed

+59
-24
lines changed

12 files changed

+59
-24
lines changed

docs/components/main-docs.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ export default {
1111
type: String,
1212
default: ''
1313
},
14+
meta: {
15+
type: Object,
16+
default: null
17+
},
1418
tag: {
1519
type: String,
1620
default: 'main'
@@ -23,6 +27,12 @@ export default {
2327
titleLead() {
2428
return this.docs.titleLead || ''
2529
},
30+
availableSince() {
31+
const { version } = this.meta || {}
32+
return version
33+
? `Available in BootstrapVue since <code class="text-nowrap">${version}</code>.`
34+
: ''
35+
},
2636
body() {
2737
return this.docs.body || this.readme
2838
},
@@ -36,7 +46,15 @@ export default {
3646
props: { play: false },
3747
domProps: { innerHTML: this.titleLead }
3848
})
39-
// CarbonAd
49+
// Available since section
50+
let $availableSinceSection = h()
51+
if (this.availableSince) {
52+
$availableSinceSection = h(Section, {
53+
props: { play: false },
54+
domProps: { innerHTML: this.availableSince }
55+
})
56+
}
57+
// Carbon Ad
4058
const $carbonAd = h(CarbonAd, { key: `ad-${this.docPath}` })
4159
// Quick links
4260
const $quickLinks = h(QuickLinks, { key: `quick-${this.docsPath}` })
@@ -48,6 +66,7 @@ export default {
4866

4967
return h(Main, { props: { tag: this.tag }, staticClass: 'bd-main' }, [
5068
$leadSection,
69+
$availableSinceSection,
5170
$carbonAd,
5271
$quickLinks,
5372
$bodySection,

docs/pages/docs/components/_slug.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,17 @@ export default {
3636
// Component importing information
3737
h(Importdoc, { props: { meta: this.meta } })
3838
])
39-
return h(MainDocs, { staticClass: 'bd-components', props: { readme: this.readme } }, [
40-
$referenceSection
41-
])
39+
40+
return h(
41+
MainDocs,
42+
{
43+
staticClass: 'bd-components',
44+
props: {
45+
readme: this.readme,
46+
meta: this.meta
47+
}
48+
},
49+
[$referenceSection]
50+
)
4251
}
4352
}

docs/pages/docs/directives/_slug.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,17 @@ export default {
2727
// Directive importing information
2828
h(Importdoc, { props: { meta: this.meta } })
2929
])
30-
return h(MainDocs, { staticClass: 'bd-components', props: { readme: this.readme } }, [
31-
$referenceSection
32-
])
30+
31+
return h(
32+
MainDocs,
33+
{
34+
staticClass: 'bd-components',
35+
props: {
36+
readme: this.readme,
37+
meta: this.meta
38+
}
39+
},
40+
[$referenceSection]
41+
)
3342
}
3443
}

docs/pages/docs/misc/_slug.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ export default {
2323
return { meta, readme }
2424
},
2525
render(h) {
26-
return h(MainDocs, { staticClass: 'bd-components', props: { readme: this.readme } })
26+
return h(MainDocs, {
27+
staticClass: 'bd-components',
28+
props: {
29+
readme: this.readme,
30+
meta: this.meta
31+
}
32+
})
2733
}
2834
}

docs/pages/docs/reference/_slug.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ export default {
1818
return { meta, readme }
1919
},
2020
render(h) {
21-
return h(MainDocs, { staticClass: 'bd-components', props: { readme: this.readme } })
21+
return h(MainDocs, {
22+
staticClass: 'bd-components',
23+
props: {
24+
readme: this.readme,
25+
meta: this.meta
26+
}
27+
})
2228
}
2329
}

src/components/aspect/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
88
## Overview
99

10-
The `<b-aspect>` component was introduced in BootstrapVue `v2.9.0`.
11-
1210
The default [aspect](<https://en.wikipedia.org/wiki/Aspect_ratio_(image)>) ratio is `1:1` (ratio of
1311
`1`), which makes the height always be at least the same as the width. The `aspect` prop can be used
1412
to specify an arbitrary aspect ratio (i.e. `1.5`) or a ratio as a string such as `'16:9'` or

src/components/calendar/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
> selection widget, which can be used to control other components, or can be used to create
55
> customized date picker inputs.
66
7-
## Oveview
7+
## Overview
88

99
`<b-calendar>` is WAI-ARIA accessibility compliant, optimized for keyboard control (arrow, page
1010
up/down, home, and end keys). Internationalization is also supported, and default's to the browser's
@@ -13,8 +13,6 @@ or page's locale, if no locale(s) are specified.
1313
If you need a date picker as a custom form control input, use the
1414
[`<b-form-datepicker>`](/docs/components/form-datepicker) component instead.
1515

16-
`<b-calendar>` was introduced in BootstrapVue `v2.5.0`.
17-
1816
```html
1917
<template>
2018
<b-row>

src/components/form-datepicker/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ inputs vary in presentation, accessibility, and in some instances are not suppor
1111
`<b-form-datepicker>` provides a consistent and accessible interface across all browser platforms
1212
and devices.
1313

14-
The `<b-form-datepicker>` component was introduced in BootstrapVue release `v2.5.0`.
15-
1614
```html
1715
<template>
1816
<div>

src/components/form-spinbutton/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
77
## Overview
88

9-
`<b-form-spinbutton>` was introduced in BootstrapVue `v2.5.0`.
10-
119
The component `<b-form-spinbutton>` is
1210
[WAI-ARIA compliant](https://www.w3.org/TR/wai-aria-practices-1.2/#spinbutton), allowing for
1311
[keyboard control](#accessibility), and supports both horizontal (default) and vertical layout.

src/components/form-timepicker/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ vary in presentation, accessibility, and in some instances are not supported by
1111
`<b-form-timepicker>` provides a consistent and accessible interface across all browser platforms
1212
and devices.
1313

14-
The `<b-form-timepicker>` component was introduced in BootstrapVue release `v2.6.0`.
15-
1614
```html
1715
<template>
1816
<div>

0 commit comments

Comments
 (0)