vue:Element:日期:月份

场景一:如何设置月份,默认显示当前月,只能显示最近六个月

效果图如下:

    

html代码:

         

Js代码:

data( ) {

   return {

扫描二维码关注公众号,回复: 15720588 查看本文章

      // 设置的默认值

      billMonthPrice: new Date().getFullYear() + '-' + (new Date().getMonth() + 1),

   }

},

注)请注意传参的时候转换下格式:billMonthStart: this.$moment(times).format('YYYY-MM')

猜你喜欢

转载自blog.csdn.net/u013592575/article/details/116457454