diff --git a/CHANGELOG.md b/CHANGELOG.md index 88eb4c52a6b552a7df1e787ae5f907f221ed8964..24a869f389bdce48060d6337ebe13d88d22af8fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,11 @@ - 支持表格支持列拖动 - 支持数据选择下拉编辑器右侧图标 - 支持编辑视图&操作视图 预制行为load +- 支持布局面板属性项直接内容编辑器配置编辑器参数 + +### Fixed + +- 修复布局面板属性项直接内容编辑器中参数是JSON字符串时,无法转换handlebars模板。 ### Changed diff --git a/src/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.scss b/src/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.scss index 0ccc124c3f4a61b2df44f0526acc2ede4f4a6a5f..83b92e5c8909319ffc473116d0d2f9f3ca3bc0f8 100644 --- a/src/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.scss +++ b/src/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.scss @@ -2,7 +2,12 @@ .cherry{ min-height: 600px; } - + @include when(disabled){ + .cherry{ + min-height: auto; + } + } + .cherry-preview--full { border-left: none; } diff --git a/src/editor/raw/ibiz-raw/ibiz-raw.tsx b/src/editor/raw/ibiz-raw/ibiz-raw.tsx index 5f27193878e9a5ba2c6ab9b13999a3623d8a7441..2710bfa44cc11b49f52a165a73b2c0ad3bc3170b 100644 --- a/src/editor/raw/ibiz-raw/ibiz-raw.tsx +++ b/src/editor/raw/ibiz-raw/ibiz-raw.tsx @@ -26,6 +26,9 @@ export const IBizRaw = defineComponent({ if (editorModel.contentType) { type = editorModel.contentType; } + if (editorModel.editorParams?.contenttype) { + type = editorModel.editorParams?.contenttype; + } if (editorModel.editorParams?.template) { template = editorModel.editorParams.template.replaceAll('//n', '\n'); } @@ -45,9 +48,17 @@ export const IBizRaw = defineComponent({ content.value = newVal; } if (template && newVal) { + let obj = null; + if (typeof newVal === 'string') { + try { + obj = JSON.parse(newVal); + } catch (error) { + ibiz.log.error('JSON字符串转换错误'); + } + } content.value = await ibiz.util.hbs.render( template, - newVal as IData, + (obj || newVal) as IData, ); } }