Skip to content

Commit

Permalink
feat:移除x-highlight,改用pre、code标签简单展现JSON数据。
Browse files Browse the repository at this point in the history
  • Loading branch information
OXOYO committed Jun 30, 2020
1 parent 89d78d8 commit 64aaaec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,14 @@
"homepage": "https://github.com/OXOYO/X-Flowchart-Vue#readme",
"dependencies": {
"@antv/g6": "^3.5.6",
"core-js": "^2.6.5",
"iview": "^3.4.2",
"mousetrap": "^1.6.3",
"register-service-worker": "^1.6.2",
"screenfull": "^4.2.1",
"v-click-outside": "^2.1.4",
"vue": "^2.6.10",
"vue-color": "^2.7.0",
"vue-i18n": "^8.14.0",
"x-highlight": "^1.0.5"
"vue-i18n": "^8.14.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.11.0",
Expand Down
14 changes: 7 additions & 7 deletions src/Editor/containers/PreviewModel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
margin: 0;
}
.preview-json {
background: #2d2d2d;
color: #cccccc;
padding: 10px;
white-space: pre-wrap;
}
}
}
Expand All @@ -36,15 +39,12 @@
:src="previewData.content"
alt=""
>
<XHighlight
<pre
v-else-if="previewData.type === 'json'"
class="preview-json"
:locale="$X.langs.locale === 'zh-CN' ? 'zh' : 'en'"
:tool="['select-all', 'copy']"
:maxHeight="1200"
:data="previewData.content"
>
</XHighlight>
<code>{{ previewData.content }}</code>
</pre>
</template>
</div>
<div slot="footer">
Expand Down
6 changes: 0 additions & 6 deletions src/xfc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ import components from './global/components'
import config from './config'
import './assets/styles/main.less'

import XHighlight from 'x-highlight'
import 'x-highlight/dist/css/XHighlight.css'
// highlight theme
import 'highlight.js/styles/zenburn.css'

import vClickOutside from 'v-click-outside'

// Vue 全局配置
Expand All @@ -38,7 +33,6 @@ const i18nInstance = i18n(Vue, 'zh-CN')

// 注册全局组件
Vue.use(components)
Vue.use(XHighlight)
// 注册指令
Vue.use(vClickOutside)

Expand Down

0 comments on commit 64aaaec

Please sign in to comment.