VUE失去焦点提交修改值


xxx.vue

<input class="ml6 w85 bdr-6 bd-none text-center" type="text" v-model="month" v-on:blur.lazy="monthCount">

 

<script>
import store from '../../store'
export default {
  data () {
    return {
      month: ''
    }
  },
  created: function () {
    this.getMonthCount()
  },
  methods: {
    monthCount () {
      let url = 'http://192.168.44.44:8083/xxx.json'
      let options = {
        method: 'PUT',
        body: 'value=' + this.month
      }
      options.headers = new Headers()
      options.headers.append('Content-Type', 'application/x-www-form-urlencoded')
      options.headers.append('token', store.state.auth.accessToken)
      fetch(url, options).then(response => response.json()).then(response => console.log(response))
    }
  }
}

</script>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM