Commit eb2927a1 authored by nature's avatar nature

placeholder 处理

parent 265ad042
...@@ -76,6 +76,11 @@ ...@@ -76,6 +76,11 @@
background-color: transparent; background-color: transparent;
border: 0; border: 0;
resize: none; resize: none;
&,
&::placeholder {
color: #666;
-webkit-text-fill-color: currentColor;
}
&-left { &-left {
text-align: left; text-align: left;
...@@ -112,13 +117,13 @@ ...@@ -112,13 +117,13 @@
&-disabled { &-disabled {
.field-label { .field-label {
color: #666; color: #999;
} }
.field-value { .field-value {
.field-body { .field-body {
.field-control { .field-control {
color: #666; color: #999;
} }
} }
} }
......
...@@ -104,6 +104,10 @@ export default { ...@@ -104,6 +104,10 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
showPlaceholder: {
type: Boolean,
default: true,
},
}, },
data () { data () {
return { return {
...@@ -125,7 +129,9 @@ export default { ...@@ -125,7 +129,9 @@ export default {
return !!(this.leftIcon || this.$slots['left-icon']) return !!(this.leftIcon || this.$slots['left-icon'])
}, },
dataPlaceholder () { dataPlaceholder () {
if (this.showPlaceholder && !this.disabled) {
return this.placeholder ? this.placeholder : this.label ? '请输入' + this.label : '' return this.placeholder ? this.placeholder : this.label ? '请输入' + this.label : ''
}
}, },
showClean () { showClean () {
let vm = this let vm = this
......
...@@ -174,7 +174,7 @@ export default { ...@@ -174,7 +174,7 @@ export default {
return !!(this.rightIcon || this.$slots['right-icon']) return !!(this.rightIcon || this.$slots['right-icon'])
}, },
placehold () { placehold () {
if (this.showPlaceholder) { if (this.showPlaceholder && !this.readonly && !this.disabled) {
return this.placeholder ? this.placeholder : this.label ? '请输入' + this.label : '' return this.placeholder ? this.placeholder : this.label ? '请输入' + this.label : ''
} }
}, },
......
...@@ -115,6 +115,10 @@ export default { ...@@ -115,6 +115,10 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
showPlaceholder: {
type: Boolean,
default: true,
},
}, },
data () { data () {
return { return {
...@@ -173,7 +177,9 @@ export default { ...@@ -173,7 +177,9 @@ export default {
} }
}, },
selectPlaceholder () { selectPlaceholder () {
if (this.showPlaceholder && !this.disabled) {
return this.placeholder ? this.placeholder : this.label ? '请输入' + this.label : '' return this.placeholder ? this.placeholder : this.label ? '请输入' + this.label : ''
}
}, },
}, },
methods: { methods: {
......
...@@ -124,6 +124,10 @@ export default { ...@@ -124,6 +124,10 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
showPlaceholder: {
type: Boolean,
default: true,
},
}, },
data () { data () {
return { return {
...@@ -158,7 +162,9 @@ export default { ...@@ -158,7 +162,9 @@ export default {
} }
}, },
selectPlaceholder () { selectPlaceholder () {
if (this.showPlaceholder && !this.disabled) {
return this.placeholder ? this.placeholder : this.label ? '请输入' + this.label : '' return this.placeholder ? this.placeholder : this.label ? '请输入' + this.label : ''
}
}, },
}, },
watch: { 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