要件は、ページに表示される日付がクリックされたときの日付であることです。
uview ドキュメントには、各列のデフォルトのインデックスを設定するためのdefaultIndex 属性がありますが、効果はありません。
解決策: innerValue を使用する
1. セレクターに ref を追加します
<u-datetime-picker :maxDate='maxDate' closeOnClickOverlay @close='yearmonthshowClose' immediateChange
ref="picker" @cancel='yearmonthshowClose' @confirm='yearmonthshowSure'
:show="yearmonthshow" v-model="yearmonthvalue" mode="date">
</u-datetime-picker>
2. クリックして日付ポップアップ ボックスを表示する場所に使用します。
//点击显示时间选择器
yearmonthshowBtn() {
this.yearmonthshow = true
//new Date(this.endDate).getTime()为你需要在选择器上显示的时间戳
this.$refs.picker.innerValue=new Date(this.endDate).getTime()
}