1.使用周选择器
<el-date-picker
id='getweekDate'
v-model="weekDate"
type="week"
format="yyyy 第 WW 周"
placeholder="选择周">
2.创建字段
data(){
return {
weekData: null,
weekDataNow: null
}
}
3.使用watch监听
watch: {
weekData() {
if( this.weekData !== null) {
this.$nextTick(()=>{
this.weekDataNow = document.querySelector('#getweekData').value
})
}
}
}
完成
4.调用weekDataNow即可