fix(md-loader): code is compiled to dynamic content

This commit is contained in:
07akioni 2021-01-21 16:35:58 +08:00
parent d1d4e69b51
commit 33b67676cb
2 changed files with 1 additions and 2 deletions

View File

@ -41,7 +41,7 @@ function createRenderer (wrapCodeWithCard = true) {
)
}
const highlighted = hljs.highlight(language, code).value
const content = `<n-code><pre>${highlighted}</pre></n-code>`
const content = `<n-code><pre v-pre>${highlighted}</pre></n-code>`
return wrapCodeWithCard
? `<n-card size="small" class="md-card">${content}</n-card>`
: content

View File

@ -31,7 +31,6 @@ function mapSlot (
for (let i = 0; i < defaultSlot.length; ++i) {
const wrappedInstance = defaultSlot[i]
const name = (wrappedInstance.type as any)?.name
console.log(name)
if (name === 'RadioButton') {
isButtonGroup = true
}