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