mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-04 20:27:44 +08:00
chore: update doc template (#2142)
This commit is contained in:
parent
da622e10d1
commit
0cac0bda38
@ -77,7 +77,8 @@ const version = '1.0.0' // element version
|
||||
const stripTemplateAndRemoveTemplate = code => {
|
||||
const result = removeSetup(stripTemplate(code))
|
||||
if (result.indexOf('<template>') === 0) {
|
||||
return result.replace(/^<template>/, '').replace(/<\/template>$/,'')
|
||||
const html = result.replace(/^<template>/, '').replace(/<\/template>$/,'')
|
||||
return html.replace(/^[\r?\n|\r]/, '').replace(/[\r?\n|\r]$/, '').trim()
|
||||
}
|
||||
return result
|
||||
}
|
||||
@ -196,12 +197,15 @@ export default {
|
||||
nextTick(() => {
|
||||
const highlight = this.$el.querySelector('.highlight')
|
||||
const hlcode = highlight.querySelector('pre code')
|
||||
hlcode.innerHTML = sanitizeHTML(`<template>${this.codepen.html}</template>
|
||||
|
||||
<script>
|
||||
const innerScript = `<script>
|
||||
${this.displayDemoCode}
|
||||
${'</sc' + 'ript>'}
|
||||
`)
|
||||
`
|
||||
hlcode.innerHTML = sanitizeHTML(`<template>
|
||||
${this.codepen.html}
|
||||
</template>
|
||||
|
||||
${this.displayDemoCode ? innerScript : ''}`)
|
||||
|
||||
nextTick(() => {
|
||||
if (this.$el.getElementsByClassName('description').length === 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user