Skip to content

Commit b39f638

Browse files
committed
fix: #185 #145 !#zh: 修正预览页文字模块双击后出现富文本编辑问题
1 parent 2a3a7df commit b39f638

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

front-end/h5/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@luban-h5/lbc-button": "^0.0.3",
1818
"@luban-h5/lbp-slide": "^0.0.7",
1919
"@luban-h5/lbs-text-align": "^0.0.3",
20-
"@luban-h5/plugin-common-props": "^0.1.3",
20+
"@luban-h5/plugin-common-props": "^0.1.6",
2121
"animate.css": "^3.7.2",
2222
"ant-design-vue": "^1.3.14",
2323
"core-js": "^2.6.5",

front-end/h5/src/components/core/editor/edit-panel/props.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export default {
138138
{
139139
Object
140140
.entries(props)
141-
.filter(([propKey, propConfig]) => propConfig.editor && !propConfig.editor.custom)
141+
.filter(([propKey, propConfig]) => propConfig.visible && propConfig.editor && !propConfig.editor.custom)
142142
.map(([propKey, propConfig]) => this.renderPropFormItem(h, { propKey, propConfig }))
143143
}
144144
</a-form>

front-end/h5/src/components/plugins/lbp-text.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import './styles/text-overwrite-quil-snow-theme.scss'
1818

1919
export default {
2020
render (h) {
21+
const canEdit = this.canEdit && this.editorMode === 'edit'
2122
const style = {
2223
position: 'relative',
2324
color: `${this.color} !important`,
@@ -49,7 +50,7 @@ export default {
4950
style={style}
5051
>
5152
{
52-
this.canEdit
53+
canEdit
5354
? <quillEditor
5455
content={this.text}
5556
options={{
@@ -87,11 +88,16 @@ export default {
8788
}
8889
},
8990
props: {
90-
backgroundColor: PropTypes.color({ label: '背景色' }),
91-
borderWidth: PropTypes.number({ label: '边框宽度(px)' }),
91+
backgroundColor: PropTypes.color({ label: '背景色', defaultValue: 'rgba(0, 0, 0, 0)' }),
92+
borderWidth: PropTypes.number({ label: '边框宽度(px)', defaultValue: 0 }),
9293
borderRadius: PropTypes.number({ label: '圆角(px)' }),
9394
borderColor: PropTypes.color({ label: '边框颜色' }),
94-
text: PropTypes.string({ label: '双击修改文字' })
95+
text: PropTypes.string({ label: '内容', defaultValue: '双击修改文字', visible: false }),
96+
editorMode: PropTypes.string({
97+
defaultValue: 'preview', // 可选值: preview/edit
98+
label: '模式',
99+
visible: false
100+
})
95101
},
96102
editorConfig: {
97103
}

front-end/h5/yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -792,10 +792,10 @@
792792
resolved "https://registry.yarnpkg.com/@luban-h5/plugin-common-props/-/plugin-common-props-0.0.1.tgz#10fe5d5b2dda1db64912b3b99779aec60b5ea956"
793793
integrity sha512-D8UEBht2BCJt8YDHqcYj0hQmn3WM3QdX3Rw8eaZP02o0NeNe2oDPKE4mCM3eN9U1ygcrDf9bR48RB9YgHJRHGA==
794794

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

800800
"@mrmlnc/readdir-enhanced@^2.2.1":
801801
version "2.2.1"

0 commit comments

Comments
 (0)