Commit 8f3dc3c8 by 李少勇

修改基础组件placeholder的问题

parent c1c85b12
......@@ -11,6 +11,7 @@
clearable
ref="add"
v-bind:disabled="isDisable"
:placeholder="placeholderEnable || placeholder || $t('components.请选择')"
></el-input>
<i class="date-pick-btn el-icon-date" >
<el-date-picker
......@@ -67,6 +68,10 @@ export default {
type: String,
default: undefined
},
placeholder:{
type: String,
default: null
},
// 此对象为markset或者modifySet所在的对象,如果传了此对象可以标记当前对象下的字段为红色下划线
markSetData: {
type: Object,
......@@ -102,6 +107,14 @@ export default {
return this.mode === 'display' || this.disabled
}
},
placeholderEnable(){
let label = this.$parent.label
let curLabel = ''
if (label) {
curLabel = this.$i18n.locale === 'en' ? this.$t('components.请选择') + ' ' + this.$t('components.' + label) : this.$t('components.请选择') + this.$t('components.' + label)
}
return curLabel
},
highlight() {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
},
......
......@@ -7,6 +7,7 @@
type="datetime"
v-bind:disabled="isDisable"
v-on="$listeners"
:placeholder="placeholderEnable || placeholder || $t('components.请选择')"
:value-format="valueFormat" :format="format"
@change="handleChange"
></el-date-picker>
......@@ -42,6 +43,10 @@ export default {
type: String,
default: undefined
},
placeholder:{
type: String,
default: null
},
// 此对象为markset或者modifySet所在的对象,如果传了此对象可以标记当前对象下的字段为红色下划线
markSetData: {
type: Object,
......@@ -69,6 +74,14 @@ export default {
return this.mode === 'display' || this.disabled
}
},
placeholderEnable(){
let label = this.$parent.label
let curLabel = ''
if (label) {
curLabel = this.$i18n.locale === 'en' ? this.$t('components.请选择') + ' ' + this.$t('components.' + label) : this.$t('components.请选择') + this.$t('components.' + label)
}
return curLabel
},
highlight() {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
},
......
<template>
<el-date-picker :id="id" :class="{'highlight': highlight}" placeholder="选择日期" type="date" :picker-options="pickerOptions" v-model="model" v-bind="$attrs"
<el-date-picker
:id="id" :class="{'highlight': highlight}"
:placeholder="placeholderEnable || placeholder || $t('components.请选择')"
type="date" :picker-options="pickerOptions" v-model="model" v-bind="$attrs"
v-on="$listeners" v-bind:disabled="isDisable" value-format="yyyyMMdd" format="yyyy-MM-dd"></el-date-picker>
</template>
......@@ -17,6 +20,10 @@
id: {
type: String,
default: undefined
},
placeholder:{
type: String,
default: null
}
},
computed: {
......@@ -36,6 +43,14 @@
return this.mode === 'display' || this.disabled
}
},
placeholderEnable(){
let label = this.$parent.label
let curLabel = ''
if (label) {
curLabel = this.$i18n.locale === 'en' ? this.$t('components.请选择') + ' ' + this.$t('components.' + label) : this.$t('components.请选择') + this.$t('components.' + label)
}
return curLabel
},
highlight () {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
}
......
......@@ -11,8 +11,8 @@
v-bind:disabled="isDisable"
:maxlength="maxlength"
:show-word-limit="isLimitChar ? false : showWordLimit"
:placeholder="placeholderEnable || placeholder || $t('components.请输入')"
@change="handleChange"
:placeholder="placeholderEnable"
>
<template v-slot:suffix>
<slot name="suffix"></slot>
......@@ -100,7 +100,12 @@ export default {
return this.mode === 'display' || this.disabled
},
placeholderEnable(){
return this.isDisable?"":this.placeholder
let label = this.$parent.label || this.$parent.label
let curLabel = ''
if (label) {
curLabel = this.$i18n.locale === 'en' ? this.$t('components.请输入') + ' ' + this.$t('components.' + label) : this.$t('components.请输入') + this.$t('components.' + label)
}
return curLabel
},
highlight () {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
......
......@@ -10,6 +10,7 @@
v-on="$listeners"
v-bind:disabled="isDisable"
:maxlength="maxlength"
:placeholder="placeholderEnable || placeholder || $t('components.请输入')"
@blur="onBlur"
@focus="focus"
@change="handleChange"
......@@ -67,6 +68,10 @@ export default {
type: String,
default: ""
},
placeholder:{
type: String,
default: null
},
// 此对象为markset或者modifySet所在的对象,如果传了此对象可以标记当前对象下的字段为红色下划线
markSetData: {
type: Object,
......@@ -115,6 +120,14 @@ export default {
isDisable() {
return this.mode === "display" || this.disabled;
},
placeholderEnable(){
let label = this.$parent.label
let curLabel = ''
if (label) {
curLabel = this.$i18n.locale === 'en' ? this.$t('components.请输入') + ' ' + this.$t('components.' + label) : this.$t('components.请输入') + this.$t('components.' + label)
}
return curLabel
},
curPrecision() {
if (this.currency === "KRW" || this.currency === "JPY") {
return 0
......
<template>
<el-input :id="id" ref="form-item" v-model="model" type="textarea" v-bind="$attrs" v-on="$listeners" v-bind:disabled="isDisable" :rows="maxRows" resize="none" />
<el-input
:id="id" ref="form-item"
v-model="model" type="textarea"
v-bind="$attrs"
v-on="$listeners"
v-bind:disabled="isDisable"
:rows="maxRows"
resize="none"
:placeholder="placeholderEnable || placeholder || $t('components.请输入')"
/>
</template>
<script>
......@@ -24,25 +33,37 @@ export default {
id: {
type: String,
default: undefined
}
},
placeholder: {
type: String,
default: null
},
},
computed: {
model: {
get () {
get() {
let value = this.format(this.value)
return value
},
set (newVal) {
set(newVal) {
this.$emit('input', newVal)
}
},
mode () {
mode() {
return this.$store.state.Status.mode
},
isDisable() {
return this.mode === 'display' || this.disabled
},
highlight () {
return this.mode === 'display' || this.disabled
},
placeholderEnable() {
let label = this.$parent.label
let curLabel = ''
if (label) {
curLabel = this.$i18n.locale === 'en' ? this.$t('components.请输入') + ' ' + this.$t('components.' + label) : this.$t('components.请输入') + this.$t('components.' + label)
}
return curLabel
},
highlight() {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
}
},
......
......@@ -9,6 +9,7 @@
v-bind="$attrs"
v-on="$listeners"
v-bind:disabled="isDisable"
:placeholder="placeholderEnable || placeholder || $t('components.请输入')"
@blur="blurEvent"
@change="handleChange"
/>
......@@ -38,6 +39,10 @@ export default {
type: String,
default: undefined
},
placeholder:{
type: String,
default: null
},
// 此对象为markset或者modifySet所在的对象,如果传了此对象可以标记当前对象下的字段为红色下划线
markSetData: {
type: Object,
......@@ -63,6 +68,14 @@ export default {
isDisable() {
return this.mode === 'display' || this.disabled
},
placeholderEnable(){
let label = this.$parent.label
let curLabel = ''
if (label) {
curLabel = this.$i18n.locale === 'en' ? this.$t('components.请输入') + ' ' + this.$t('components.' + label) : this.$t('components.请输入') + this.$t('components.' + label)
}
return curLabel
},
highlight () {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
},
......
......@@ -10,6 +10,7 @@
v-bind:disabled="isDisable"
:rows="maxRows"
resize="none"
:placeholder="placeholderEnable || placeholder || $t('components.请输入')"
@blur="blurEvent"
@change="handleChange"
/>
......@@ -42,6 +43,10 @@ export default {
type: Number,
default: 3
},
placeholder:{
type: String,
default: null
},
// 此对象为markset或者modifySet所在的对象,如果传了此对象可以标记当前对象下的字段为红色下划线
markSetData: {
type: Object,
......@@ -67,6 +72,14 @@ export default {
isDisable() {
return this.mode === 'display' || this.disabled
},
placeholderEnable(){
let label = this.$parent.label
let curLabel = ''
if (label) {
curLabel = this.$i18n.locale === 'en' ? this.$t('components.请输入') + ' ' + this.$t('components.' + label) : this.$t('components.请输入') + this.$t('components.' + label)
}
return curLabel
},
},
watch: {
disabled(newVal) {
......
......@@ -16,7 +16,7 @@
v-on="$listeners"
v-bind:disabled="isDisable"
:autosize="autosize"
:placeholder="placeholder"
:placeholder="placeholderEnable || placeholder || $t('components.请输入')"
:show-word-limit="!isLimitChar && !isIgnoreLine"
:maxlength="rows * cols"
@blur="onBlur"
......@@ -196,6 +196,14 @@ export default {
isDisable() {
return this.mode === 'display' || this.disabled
},
placeholderEnable(){
let label = this.$parent.label
let curLabel = ''
if (label) {
curLabel = this.$i18n.locale === 'en' ? this.$t('components.请输入') + ' ' + this.$t('components.' + label) : this.$t('components.请输入') + this.$t('components.' + label)
}
return curLabel
},
highlight () {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
},
......
......@@ -8,7 +8,7 @@
v-bind:disabled="isDisable"
:clearable="clearable"
v-on="$listeners"
:placeholder="placeholderEnable"
:placeholder="placeholderEnable || placeholder || $t('components.请选择')"
@change="handleChange"
@keyup.delete.native="deleteValue"
>
......@@ -146,9 +146,14 @@ export default {
isDisable() {
return this.mode === "display" || this.disabled;
},
placeholderEnable(){
return this.isDisable?"":this.placeholder
},
placeholderEnable(){
let label = this.$parent.label
let curLabel = ''
if (label) {
curLabel = this.$i18n.locale === 'en' ? this.$t('components.请选择') + ' ' + this.$t('components.' + label) : this.$t('components.请选择') + this.$t('components.' + label)
}
return curLabel
},
highlight() {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1;
},
......
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