diff --git a/docs/components/anchored-heading.js b/docs/components/anchored-heading.js new file mode 100644 index 00000000000..e391ffef630 --- /dev/null +++ b/docs/components/anchored-heading.js @@ -0,0 +1,24 @@ +export default { + props: { + level: { + type: [Number, String], + default: 2 + }, + id: { + type: String, + default: '' + } + }, + render(h) { + const $anchor = h( + 'b-link', + { + staticClass: 'anchorjs-link', + attrs: { to: { hash: `#${this.id}` }, 'aria-label': 'Anchor' } + }, + [h(false)] + ) + const $content = h('span', { staticClass: 'bd-content-title' }, [this.$slots.default, $anchor]) + return h(`h${this.level}`, { attrs: { id: this.id, tabindex: '-1' } }, [$content]) + } +} diff --git a/docs/components/componentdoc.vue b/docs/components/componentdoc.vue index 5521ae909d9..7d807db2900 100644 --- a/docs/components/componentdoc.vue +++ b/docs/components/componentdoc.vue @@ -5,7 +5,9 @@ > -

{{ tag }}

+ + {{ tag }} +
@@ -15,7 +17,9 @@
-

Component aliases

+ + Component aliases +

{{ tag }} can also be used via the following aliases:

-

Properties

+ + Properties + -