Commit eb2927a1 authored by nature's avatar nature

placeholder 处理

parent 265ad042
......@@ -76,6 +76,11 @@
background-color: transparent;
border: 0;
resize: none;
&,
&::placeholder {
color: #666;
-webkit-text-fill-color: currentColor;
}
&-left {
text-align: left;
......@@ -112,13 +117,13 @@
&-disabled {
.field-label {
color: #666;
color: #999;
}
.field-value {
.field-body {
.field-control {
color: #666;
color: #999;
}
}
}
......
......@@ -104,6 +104,10 @@ export default {
type: Boolean,
default: false,
},
showPlaceholder: {
type: Boolean,
default: true,
},
},
data () {
return {
......@@ -125,7 +129,9 @@ export default {
return !!(this.leftIcon || this.$slots['left-icon'])
},
dataPlaceholder () {
if (this.showPlaceholder && !this.disabled) {
return this.placeholder ? this.placeholder : this.label ? '请输入' + this.label : ''
}
},
showClean () {
let vm = this
......
......@@ -174,7 +174,7 @@ export default {
return !!(this.rightIcon || this.$slots['right-icon'])
},
placehold () {
if (this.showPlaceholder) {
if (this.showPlaceholder && !this.readonly && !this.disabled) {
return this.placeholder ? this.placeholder : this.label ? '请输入' + this.label : ''
}
},
......
......@@ -115,6 +115,10 @@ export default {
type: Boolean,
default: false,
},
showPlaceholder: {
type: Boolean,
default: true,
},
},
data () {
return {
......@@ -173,7 +177,9 @@ export default {
}
},
selectPlaceholder () {
if (this.showPlaceholder && !this.disabled) {
return this.placeholder ? this.placeholder : this.label ? '请输入' + this.label : ''
}
},
},
methods: {
......
......@@ -124,6 +124,10 @@ export default {
type: Boolean,
default: false,
},
showPlaceholder: {
type: Boolean,
default: true,
},
},
data () {
return {
......@@ -158,7 +162,9 @@ export default {
}
},
selectPlaceholder () {
if (this.showPlaceholder && !this.disabled) {
return this.placeholder ? this.placeholder : this.label ? '请输入' + this.label : ''
}
},
},
watch: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment