Skip to content

Commit 35965ff

Browse files
committed
fix: #105
1 parent f21bf35 commit 35965ff

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

front-end/h5/src/components/plugins/common/props.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default {
3131
},
3232
backgroundColor: {
3333
type: String,
34-
default: 'transparent',
34+
default: '#ffffff',
3535
editor: {
3636
type: 'a-input', // lbs-color-picker
3737
label: '背景颜色',
@@ -43,7 +43,10 @@ export default {
4343
},
4444
color: {
4545
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',
4750
editor: {
4851
type: 'a-input',
4952
label: '文字颜色',

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ export default {
4242
},
4343
backgroundColor: {
4444
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+
4650
default: '#ffffff',
4751
editor: {
4852
type: 'a-input', // lbs-color-picker

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default {
1111
position: 'relative',
1212
color: `${this.color} !important`,
1313
textDecoration: 'none',
14-
backgroundColor: this.backgroundColor || 'transparent',
14+
backgroundColor: this.backgroundColor || '#ffffff',
1515
lineHeight: `${this.lineHeight}em`,
1616
border: `${this.borderWidth}px solid ${this.borderColor}`,
1717
borderRadius: `${this.borderRadius}px`

0 commit comments

Comments
 (0)