New to Vue and not much of a lover of Javascript so I have a Vue component thats using Axios to get some data which I have in the console. I simply cant get the code to out to my form elements.
So I have Axios Intercepting the response and getting the data
methods: {
},
mounted: function() {
axios.interceptors.response.use(function (response) {
return response.data;
});
},
destroyed: function() {
}
}
So that is mounted on page load and in my data I have
data() {
return {
formpersonaldetails: {},
title: this.results.title,
titleoptions: ['Mr', 'Mrs', 'Miss', 'Ms'],
fname: this.results.fname,
sname: this.results.sname,
dob: this.results.dob,
Which as you can guess doesnt work, so where am I going wrong??
Response looks like so:
{"id":2,"user_id":null,"fname":"Graham","sname":"Morby-Raybould","dob":"1982-07-10T08:22:00.000Z","gender":"Male","nationality":"British","mobile":null,"telephone":null,"hname":"","address2":"","address3":"","postcode":"","noktitle":"","nokfname":"","noksname":"","nokcontactnumber":"","nokhname":"","nokaddress2":"","nokaddress3":"","nokpostcode":"","emp_type":"","trade":"","ninumber":"","utrnumber":"","vatreg":null,"vatcert":"","created_at":"2017-10-10 08:22:37","updated_at":"2017-10-10 08:22:37"}