一:显示年月
<el-date-picker v-model="selectMonth" type="month" placeholder="选择月" @change="jobSearch" value-format="yyyy-MM"></el-date-picker>
js代码:
<script>
export default {
data() {
return {
selectMonth:''
}
},
created() {
this.initData({});
},
methods: {
jobSearch() {
this.getJobListByMonth();
},
async initData(data) {
//获取当前时间
var now = new Date();
var monthn = now.getMonth()+1;
var yearn = now.getFullYear();
this.selectMonth = yearn+"-"+monthn;
this.selectUser = parseInt(sessionStorage.getItem("userid"));
// this.getWeekJobList({
// userid: sessionStorage.getItem("userid"),
// weekid: "1"
// });
this.getJobListByMonth();
},
async getJobListByMonth(data) {
}
}
}
</script><