Commit 07f47fcd985717a147f2e8ee97df34de218bac1e
1 parent
29cb41f6
fix(plugin): do not auto-fill default placeholder if user delete it manually
Showing
2 changed files
with
8 additions
and
3 deletions
front-end/h5/src/components/core/editor/edit-panel/props.js
| ... | ... | @@ -38,7 +38,12 @@ export default { |
| 38 | 38 | props: { |
| 39 | 39 | ...item.prop, |
| 40 | 40 | // 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] | |
| 42 | 47 | }, |
| 43 | 48 | on: { |
| 44 | 49 | // https://vuejs.org/v2/guide/render-function.html#v-model | ... | ... |
front-end/h5/src/components/plugins/lbp-form-input.js
| ... | ... | @@ -35,7 +35,7 @@ export default { |
| 35 | 35 | }, |
| 36 | 36 | placeholder: { |
| 37 | 37 | type: String, |
| 38 | - default: '请填写提示文字' | |
| 38 | + default: '姓名' | |
| 39 | 39 | }, |
| 40 | 40 | required: { |
| 41 | 41 | type: Boolean, |
| ... | ... | @@ -89,7 +89,7 @@ export default { |
| 89 | 89 | type: 'a-input', |
| 90 | 90 | label: '提示文字', |
| 91 | 91 | require: true, |
| 92 | - defaultPropValue: '请填写提示文字' | |
| 92 | + defaultPropValue: '姓名' | |
| 93 | 93 | }, |
| 94 | 94 | fontSize: { |
| 95 | 95 | type: 'a-input-number', | ... | ... |