uni-app时间选择器只显示年月
uni-app时间选择器只显示年月
·
年月日代码
<picker class="text" mode="date" :value="monthTime" start="2021-01" end="2050-09"
@change="DateChange">
<view class="picker">
{{monthTime}}
</view>
<image class="img" src="../static/wallet/top.png" mode=""></image>
</picker>
显示年月日效果
年月代码
<picker class="text" mode="date" fields="month" :value="monthTime" start="2021-01" end="2050-09"
@change="DateChange">
<view class="picker">
{{monthTime}}
</view>
<image class="img" src="../static/wallet/top.png" mode=""></image>
</picker>
只显示年月效果
只显示年代码
<picker class="text" mode="date" fields="year" :value="monthTime" start="2021-01" end="2050-09"
@change="DateChange">
<view class="picker">
{{monthTime}}
</view>
<image class="img" src="../static/wallet/top.png" mode=""></image>
</picker>
只显示年效果
显示年月只需要加上:fields="month"
显示年只需要加上:fields="year"
DateChange(e) {
this.monthTime = e.detail.value
},
更多推荐
已为社区贡献1条内容
所有评论(0)