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,7 +31,7 @@ export default {
31 }, 31 },
32 backgroundColor: { 32 backgroundColor: {
33 type: String, 33 type: String,
34 - default: 'transparent', 34 + default: '#ffffff',
35 editor: { 35 editor: {
36 type: 'a-input', // lbs-color-picker 36 type: 'a-input', // lbs-color-picker
37 label: '背景颜色', 37 label: '背景颜色',
@@ -43,7 +43,10 @@ export default { @@ -43,7 +43,10 @@ export default {
43 }, 43 },
44 color: { 44 color: {
45 type: String, 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 editor: { 50 editor: {
48 type: 'a-input', 51 type: 'a-input',
49 label: '文字颜色', 52 label: '文字颜色',
front-end/h5/src/components/plugins/lbp-background.js
@@ -42,7 +42,11 @@ export default { @@ -42,7 +42,11 @@ export default {
42 }, 42 },
43 backgroundColor: { 43 backgroundColor: {
44 type: String, 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 default: '#ffffff', 50 default: '#ffffff',
47 editor: { 51 editor: {
48 type: 'a-input', // lbs-color-picker 52 type: 'a-input', // lbs-color-picker
front-end/h5/src/components/plugins/lbp-text.js
@@ -11,7 +11,7 @@ export default { @@ -11,7 +11,7 @@ export default {
11 position: 'relative', 11 position: 'relative',
12 color: `${this.color} !important`, 12 color: `${this.color} !important`,
13 textDecoration: 'none', 13 textDecoration: 'none',
14 - backgroundColor: this.backgroundColor || 'transparent', 14 + backgroundColor: this.backgroundColor || '#ffffff',
15 lineHeight: `${this.lineHeight}em`, 15 lineHeight: `${this.lineHeight}em`,
16 border: `${this.borderWidth}px solid ${this.borderColor}`, 16 border: `${this.borderWidth}px solid ${this.borderColor}`,
17 borderRadius: `${this.borderRadius}px` 17 borderRadius: `${this.borderRadius}px`