M
M
MarEeeeeee2020-10-03 22:06:02
Vue.js
MarEeeeeee, 2020-10-03 22:06:02

Why is Vue outputting some obscure Proxy{} object?

My fetch request. When I try to output this.firstWindow to the console, the Proxy object is displayed there. What it is?

And question number two. It is required to execute the following code snippet this.firstDir = this.firstWindow[0].dir. It is commented out in the provided snippet as the console throws an error. Why is this happening and how to get data into the firtDir variable?

fetch('/1', {
    method: 'POST', // *GET, POST, PUT, DELETE, etc.
    mode: 'cors', // no-cors, *cors, same-origin    
    headers: {
       'Content-Type': 'application/json',
        'Accept': 'application/json'
    },
   
  })
    .then(response => response.json())    
    .then(json => this.firstWindow =  json.table)
    // .then(this.firstDir = this.firstWindow[0].dir)
    .then(json => console.log(json))
    .then(console.log(this.firstWindow))
   ;

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question