From a4d2eda8336fb9614a0c94b32885f9beeae19c2c Mon Sep 17 00:00:00 2001 From: iamkun Date: Sun, 27 Dec 2020 23:54:01 +0800 Subject: [PATCH] chore: fix doc preview error (#1135) --- website/components/demo-block.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/website/components/demo-block.vue b/website/components/demo-block.vue index 36b0e3b7f6..4daa06d4c9 100644 --- a/website/components/demo-block.vue +++ b/website/components/demo-block.vue @@ -50,7 +50,13 @@ import hljs from 'highlight.js' import compoLang from '../i18n/component.json' import { stripScript, stripStyle, stripTemplate } from '../util' const version = '1.0.0' // element version - +const stripTemplateAndRemoveTemplate = code => { + const result = stripTemplate(code) + if (result.indexOf('