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>
略懂,略懂....

浙公网安备 33010602011771号