Skip to content

Commit

Permalink
fix: #105
Browse files Browse the repository at this point in the history
  • Loading branch information
ly525 committed Nov 23, 2019
1 parent f21bf35 commit 35965ff
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions front-end/h5/src/components/plugins/common/props.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default {
},
backgroundColor: {
type: String,
default: 'transparent',
default: '#ffffff',
editor: {
type: 'a-input', // lbs-color-picker
label: '背景颜色',
Expand All @@ -43,7 +43,10 @@ export default {
},
color: {
type: String,
default: 'black',
// 注意,根据 MDN 文档,颜色选择器的 value 只能是:# + 6个16进制字符串
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/color#Value
// 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.
default: '#000000',
editor: {
type: 'a-input',
label: '文字颜色',
Expand Down
6 changes: 5 additions & 1 deletion front-end/h5/src/components/plugins/lbp-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ export default {
},
backgroundColor: {
type: String,
// TODO 为什么 transparent 无效?
// Q: 为什么 transparent 无效?
// A: 注意,根据 MDN 文档,颜色选择器的 value 只能是:# + 6个16进制字符串
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/color#Value
// 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.

default: '#ffffff',
editor: {
type: 'a-input', // lbs-color-picker
Expand Down
2 changes: 1 addition & 1 deletion front-end/h5/src/components/plugins/lbp-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default {
position: 'relative',
color: `${this.color} !important`,
textDecoration: 'none',
backgroundColor: this.backgroundColor || 'transparent',
backgroundColor: this.backgroundColor || '#ffffff',
lineHeight: `${this.lineHeight}em`,
border: `${this.borderWidth}px solid ${this.borderColor}`,
borderRadius: `${this.borderRadius}px`
Expand Down

0 comments on commit 35965ff

Please sign in to comment.