40 lines
747 B
Vue
40 lines
747 B
Vue
<template>
|
|
<view>
|
|
<picker mode="date" fields="month" @change="onDateChange" :value="DateValue">
|
|
<!-- <view>
|
|
<text style="color: red; margin: 0 10rpx">*</text>
|
|
<text>选择时间</text>
|
|
</view> -->
|
|
|
|
<view class="time-container">
|
|
<view class="date-picker">{{ DateValue }}</view>
|
|
<text>></text>
|
|
</view>
|
|
</picker>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
DateValue: this.$moment().format('YYYY-MM')
|
|
}
|
|
},
|
|
methods: {
|
|
onDateChange(e) {
|
|
this.DateValue = e.detail.value
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.time-container {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 0 38rpx;
|
|
}
|
|
</style>
|