Commit 35965ffd97aa18940a4beaf42a266853d33aa31a

Authored by ly525
1 parent f21bf355

fix: #105

front-end/h5/src/components/plugins/common/props.js
... ... @@ -31,7 +31,7 @@ export default {
31 31 },
32 32 backgroundColor: {
33 33 type: String,
34   - default: 'transparent',
  34 + default: '#ffffff',
35 35 editor: {
36 36 type: 'a-input', // lbs-color-picker
37 37 label: '背景颜色',
... ... @@ -43,7 +43,10 @@ export default {
43 43 },
44 44 color: {
45 45 type: String,
46   - default: 'black',
  46 + // 注意,根据 MDN 文档,颜色选择器的 value 只能是:# + 6个16进制字符串
  47 + // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/color#Value
  48 + // The value of an <input> element of type color is always a DOMString which contains a 7-character string specifying an RGB color in hexadecimal format.
  49 + default: '#000000',
47 50 editor: {
48 51 type: 'a-input',
49 52 label: '文字颜色',
... ...
front-end/h5/src/components/plugins/lbp-background.js
... ... @@ -42,7 +42,11 @@ export default {
42 42 },
43 43 backgroundColor: {
44 44 type: String,
45   - // TODO 为什么 transparent 无效?
  45 + // Q: 为什么 transparent 无效?
  46 + // A: 注意,根据 MDN 文档,颜色选择器的 value 只能是:# + 6个16进制字符串
  47 + // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/color#Value
  48 + // The value of an <input> element of type color is always a DOMString which contains a 7-character string specifying an RGB color in hexadecimal format.
  49 +
46 50 default: '#ffffff',
47 51 editor: {
48 52 type: 'a-input', // lbs-color-picker
... ...
front-end/h5/src/components/plugins/lbp-text.js
... ... @@ -11,7 +11,7 @@ export default {
11 11 position: 'relative',
12 12 color: `${this.color} !important`,
13 13 textDecoration: 'none',
14   - backgroundColor: this.backgroundColor || 'transparent',
  14 + backgroundColor: this.backgroundColor || '#ffffff',
15 15 lineHeight: `${this.lineHeight}em`,
16 16 border: `${this.borderWidth}px solid ${this.borderColor}`,
17 17 borderRadius: `${this.borderRadius}px`
... ...