From f9d21eb3a1089762347e8d0641030f3826b450a6 Mon Sep 17 00:00:00 2001 From: mengxiong10 <15623530290@163.com> Date: Wed, 20 Nov 2019 14:52:32 +0800 Subject: [PATCH] docs(example): fix hljs --- example/app.js | 9 ------ example/dev.html | 1 + example/helper/card.vue | 27 ++--------------- example/helper/highlight-code.vue | 50 +++++++++++++++++++++++++++++++ example/index.html | 1 + 5 files changed, 55 insertions(+), 33 deletions(-) create mode 100644 example/helper/highlight-code.vue diff --git a/example/app.js b/example/app.js index 1d29354..f8f340a 100644 --- a/example/app.js +++ b/example/app.js @@ -1,11 +1,6 @@ /* eslint-disable global-require */ /* eslint-disable import/no-extraneous-dependencies */ import fs from 'fs'; -import hljs from 'highlight.js/lib/highlight'; -import javascript from 'highlight.js/lib/languages/javascript'; -import xml from 'highlight.js/lib/languages/xml'; -import 'highlight.js/styles/atom-one-light.css'; - import Container from './helper/container.vue'; import Card from './helper/card.vue'; import Basic from './demo/Basic.vue'; @@ -23,9 +18,6 @@ import Disabled from './demo/Disabled.vue'; import docEn from './en.md'; import docZhCN from './zh-cn.md'; -hljs.registerLanguage('javascript', javascript); -hljs.registerLanguage('xml', xml); - const components = [ { id: 'Basic', @@ -133,7 +125,6 @@ const App = { }; }, mounted() { - hljs.initHighlighting(); window.onhashchange = () => { this.currentId = this.getCurrentId(); }; diff --git a/example/dev.html b/example/dev.html index 7396800..d8a17eb 100644 --- a/example/dev.html +++ b/example/dev.html @@ -6,6 +6,7 @@ Document +
diff --git a/example/helper/card.vue b/example/helper/card.vue index ee5c013..346c403 100644 --- a/example/helper/card.vue +++ b/example/helper/card.vue @@ -10,18 +10,17 @@ hide code
-
-        {{code}}
-      
+
+ + diff --git a/example/index.html b/example/index.html index f6ff292..2902bb0 100644 --- a/example/index.html +++ b/example/index.html @@ -7,6 +7,7 @@ Document +