Skip to content

Commit 07f47fc

Browse files
committed
fix(plugin): do not auto-fill default placeholder if user delete it manually
1 parent 29cb41f commit 07f47fc

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

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

+6-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ export default {
3838
props: {
3939
...item.prop,
4040
// https://vuejs.org/v2/guide/render-function.html#v-model
41-
value: editingElement.pluginProps[propKey] || item.defaultPropValue
41+
42+
// #!zh:不设置默认值的原因(下一行的代码,注释的代码):
43+
// 比如表单 input,如果用户手动删除了 placeholder的内容,程序会用defaultPropValue填充,
44+
// 表现在UI上就是:用户永远无法彻底删掉默认值(必须保留至少一个字符)
45+
// value: editingElement.pluginProps[propKey] || item.defaultPropValue
46+
value: editingElement.pluginProps[propKey]
4247
},
4348
on: {
4449
// https://vuejs.org/v2/guide/render-function.html#v-model

front-end/h5/src/components/plugins/lbp-form-input.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default {
3535
},
3636
placeholder: {
3737
type: String,
38-
default: '请填写提示文字'
38+
default: '姓名'
3939
},
4040
required: {
4141
type: Boolean,
@@ -89,7 +89,7 @@ export default {
8989
type: 'a-input',
9090
label: '提示文字',
9191
require: true,
92-
defaultPropValue: '请填写提示文字'
92+
defaultPropValue: '姓名'
9393
},
9494
fontSize: {
9595
type: 'a-input-number',

0 commit comments

Comments
 (0)