Skip to content

Commit

Permalink
fix: #185 #145 !#zh: 修正预览页文字模块双击后出现富文本编辑问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ly525 committed Jul 5, 2020
1 parent 2a3a7df commit b39f638
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion front-end/h5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@luban-h5/lbc-button": "^0.0.3",
"@luban-h5/lbp-slide": "^0.0.7",
"@luban-h5/lbs-text-align": "^0.0.3",
"@luban-h5/plugin-common-props": "^0.1.3",
"@luban-h5/plugin-common-props": "^0.1.6",
"animate.css": "^3.7.2",
"ant-design-vue": "^1.3.14",
"core-js": "^2.6.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export default {
{
Object
.entries(props)
.filter(([propKey, propConfig]) => propConfig.editor && !propConfig.editor.custom)
.filter(([propKey, propConfig]) => propConfig.visible && propConfig.editor && !propConfig.editor.custom)
.map(([propKey, propConfig]) => this.renderPropFormItem(h, { propKey, propConfig }))
}
</a-form>
Expand Down
14 changes: 10 additions & 4 deletions front-end/h5/src/components/plugins/lbp-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import './styles/text-overwrite-quil-snow-theme.scss'

export default {
render (h) {
const canEdit = this.canEdit && this.editorMode === 'edit'
const style = {
position: 'relative',
color: `${this.color} !important`,
Expand Down Expand Up @@ -49,7 +50,7 @@ export default {
style={style}
>
{
this.canEdit
canEdit
? <quillEditor
content={this.text}
options={{
Expand Down Expand Up @@ -87,11 +88,16 @@ export default {
}
},
props: {
backgroundColor: PropTypes.color({ label: '背景色' }),
borderWidth: PropTypes.number({ label: '边框宽度(px)' }),
backgroundColor: PropTypes.color({ label: '背景色', defaultValue: 'rgba(0, 0, 0, 0)' }),
borderWidth: PropTypes.number({ label: '边框宽度(px)', defaultValue: 0 }),
borderRadius: PropTypes.number({ label: '圆角(px)' }),
borderColor: PropTypes.color({ label: '边框颜色' }),
text: PropTypes.string({ label: '双击修改文字' })
text: PropTypes.string({ label: '内容', defaultValue: '双击修改文字', visible: false }),
editorMode: PropTypes.string({
defaultValue: 'preview', // 可选值: preview/edit
label: '模式',
visible: false
})
},
editorConfig: {
}
Expand Down
8 changes: 4 additions & 4 deletions front-end/h5/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -792,10 +792,10 @@
resolved "https://registry.yarnpkg.com/@luban-h5/plugin-common-props/-/plugin-common-props-0.0.1.tgz#10fe5d5b2dda1db64912b3b99779aec60b5ea956"
integrity sha512-D8UEBht2BCJt8YDHqcYj0hQmn3WM3QdX3Rw8eaZP02o0NeNe2oDPKE4mCM3eN9U1ygcrDf9bR48RB9YgHJRHGA==

"@luban-h5/plugin-common-props@^0.1.3":
version "0.1.5"
resolved "https://registry.npmjs.org/@luban-h5/plugin-common-props/-/plugin-common-props-0.1.5.tgz#531ff1cbc53284e114a1151a55d0c254c02123ce"
integrity sha512-Jrdl0AhR+cuY56RbmgqW2XmbaGDgFSpVHeGNrEiDsmcC62FSZmVp1XNIs6+0so2+rngvIX/YC6DxpUZ+P3VLSg==
"@luban-h5/plugin-common-props@^0.1.6":
version "0.1.6"
resolved "https://registry.npmjs.org/@luban-h5/plugin-common-props/-/plugin-common-props-0.1.6.tgz#b4d44dd139ac99c58274c909fb61ca6df9051aa4"
integrity sha512-0+0yuLioozw+wx+3Ui9JYTIT7mKWVtKKrSZAe49ldfmhkA0zsv2phIkAVwqDDtsxuwO0t8a0fA05GwY6WRMjIA==

"@mrmlnc/readdir-enhanced@^2.2.1":
version "2.2.1"
Expand Down

0 comments on commit b39f638

Please sign in to comment.