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

Commit e975e26

Browse files
chore(docs): fix components examples not rendering
1 parent 9155d00 commit e975e26

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

docs/components/main-docs.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ import Section from '~/components/section'
55
import { mergeData } from 'vue-functional-data-merge'
66
import { bootstrapVersion, vueVersion } from '~/content'
77

8+
const interpolate = (template, ctx) =>
9+
template.replace(/\[\[([\s\S]+?)\]\]/g, (_, key) => {
10+
key = key.trim()
11+
return ctx[key] || ''
12+
})
13+
814
// @vue/component
915
export default {
1016
name: 'BVMainDocs',
@@ -59,15 +65,13 @@ export default {
5965
const $quickLinks = h(QuickLinks)
6066

6167
// Body section
62-
const $bodySectionContent = h({
63-
delimiters: ['[[', ']]'], // change the delimiters to avoid conflicts with code examples
64-
data() {
65-
return {
68+
const $bodySectionContent = h('div', {
69+
domProps: {
70+
innerHTML: interpolate(body || '', {
6671
bootstrapVersion,
6772
vueVersion
68-
}
69-
},
70-
template: `<div>${body}</div>`
73+
})
74+
}
7175
})
7276

7377
const $bodySection = h(

0 commit comments

Comments
 (0)