vue.js使用laydate

<div id='app'>

开始时间:<input type='text' id='start' v-on:focus='getDate'>

{{startTime }}

</div>

<script>

var vue = new Vue({

  el: '#app',

  data: { startTime: '' },

  methods: {

    getDate: function () {

    var that = this;
    laydate({

      elem: '#start',
      choose: function (date) {

        that.startTime = date;
      }
    });
  }
}

});

laydate({
  elem: '#start',
  event: 'focus'
});

</script>

猜你喜欢

转载自www.cnblogs.com/vzyits/p/9099396.html