Vue js apply filter on v-model in an input field

前端 未结 7 1690
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-03 22:37

Hope someone can help me! I have made a directive wrapping the Jasny Bootstrap Plugin more specifically the input-mask thing and everything goes well!

Now I have made a

7条回答
  •  难免孤独
    2021-02-03 22:45

    When you get the value initially, adjust it to fit the input. I got it working in the ready function, but you could do this after your DB call as well:

    ready: function(){    
      var year = this.date.substr(0, 4);
      var monDay = this.date.substr(5,5);
      var result = monDay + "-" + year;
      this.date = result.replace(/-/g,"/");
    }
    

    You may have to do something similar on the way back up to your database as well.

提交回复
热议问题