diff --git a/docs/zh/components/highlight.md b/docs/zh/components/highlight.md index 3ccaa892..f8830d31 100644 --- a/docs/zh/components/highlight.md +++ b/docs/zh/components/highlight.md @@ -5,7 +5,7 @@ | 参数名 | 介绍 | 必选 | 值类型 | 可选值 | 默认值 | | --- | --- | --- | --- | --- | --- | | code | 代码字符串 | 非 | String | | console.log('you lost code prop') | -| format | 是否格式化 HTML | 非 | Boolean | | false | +| format-html | 是否格式化 HTML | 非 | Boolean | | false | ::: tip format 建议只在内容为 HTML 的时候打开,如果内容不是 HTML,设置为 true 会有负面效果 diff --git a/docs/zh/guide/change-log.md b/docs/zh/guide/change-log.md index a9b8d96b..9912f0ad 100644 --- a/docs/zh/guide/change-log.md +++ b/docs/zh/guide/change-log.md @@ -9,6 +9,7 @@ * [ 修改 ] bug fixed [#41](https://github.com/d2-projects/d2-admin/issues/41) * [ 修改 ] 侧边栏和顶栏菜单数据控制转移到 vuex 集中管理 * [ 修改 ] 页面最小宽度设置 +* [ 新增 ] d2-highlight 组件新增 format-html 参数 ## v1.1.4 diff --git a/src/components/core/d2-highlight/index.vue b/src/components/core/d2-highlight/index.vue index 47be614a..f823a3cb 100644 --- a/src/components/core/d2-highlight/index.vue +++ b/src/components/core/d2-highlight/index.vue @@ -15,7 +15,7 @@ export default { required: false, default: `console.log('you lost code prop')` }, - format: { + formatHtml: { type: Boolean, required: false, default: false @@ -36,7 +36,7 @@ export default { }, methods: { highlight () { - const code = this.format ? htmlFormat(this.code) : this.code + const code = this.formatHtml ? htmlFormat(this.code) : this.code this.highlightHTML = highlight.highlightAuto(code).value } } diff --git a/src/pages/demo/components/editor-quill/index.vue b/src/pages/demo/components/editor-quill/index.vue index 51310c2f..fe4a1cc0 100644 --- a/src/pages/demo/components/editor-quill/index.vue +++ b/src/pages/demo/components/editor-quill/index.vue @@ -8,7 +8,7 @@ @selection-change="selectionChangeHandler" @editor-change="editorChangeHandler"/> - +