We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.
submit
account is: {{ message }}
password is: {{ password }}
var v1 = new Vue({
el: '#app1',
data: {
message: 'stest',
password: '',
},
watch : {
my(v) {
this.password = this.get_password();
}
},
methods: {
get_password() {
axios.get('/accounts', {
headers: {
'Access-Control-Allow-Origin': '*',
},
crossDomain: true,
contentType: "application/json",
params: {
account: this.message,//接口配置参数(相当于url?id=xxxx)
},
}).then((res) => {
console.log(res.data['password']);//处理成功的函数 相当于success
this.password = res.data['password']
})
.catch(error => console.log(error))
}
}
})