Commit 109b37aa authored by 李超鹏's avatar 李超鹏

时间组件调整

parent 137e4bbd
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="label">{{item.label}}</div> <div class="label">{{item.label}}</div>
<div class="required" v-show="item.required">*</div> <div class="required" v-show="item.required">*</div>
<div class="input-box" @click="openShadow"> <div class="input-box" @click="openShadow">
<div class="input" :class="['input',!item.value ? 'grey' : '']">{{getName(item.value) || '请选择'}}</div> <!-- <input class="input" v-model="{{item.value | getName}}" readonly placeholder="请选择" /> --> <div class="input" :class="['input',!item.value ? 'grey' : '']">{{item.value || '请选择'}}</div>
</div> </div>
<i class="mint-cell-allow-right" @click="openShadow"></i> <i class="mint-cell-allow-right" @click="openShadow"></i>
<mt-datetime-picker <mt-datetime-picker
...@@ -44,25 +44,20 @@ export default { ...@@ -44,25 +44,20 @@ export default {
}, },
watch: { watch: {
'item.value'() {
this.value = moment(this.item.value, 'YYYY-MM-DD').toDate()
}
}, },
methods: { methods: {
openShadow() { openShadow() {
this.popupVisible = true this.popupVisible = true
this.$refs.picker.open() this.$refs.picker.open()
}, },
getName(value) {
if (!value) {
return ''
}
return moment(value.getTime()).format('YYYY/MM/DD')
},
cancel() { cancel() {
this.popupVisible = false this.popupVisible = false
}, },
handleConfirm() { handleConfirm(value) {
this.item.value = this.value this.item.value = moment(value.getTime()).format('YYYY-MM-DD')
// this.popupVisible = false
} }
} }
} }
......
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