Answer the question
In order to leave comments, you need to log in
How to convert object {__ob__: Observer}?
Good evening.
Please tell me how to solve the following problem
export default {
data() {
return {
locations: [],
posts: [],
page: 1,
perPage: 10,
pages: []
};
},
firestore() {
<b>return {
locations: db.collection("testTask") Здесь приходят данные из БД в читаемом виде
};</b>
},
computed: {
displayedPosts() {
return this.paginate(this.posts);
}
},
methods: {
getPosts() {
this.posts = [];
this.pages = [];
<b>const data = this.locations; </b> <--- здесь объект превращается в {__ob__: Observer}
console.log(data);
for (let i = 0; i < data.length; i++) {
this.posts.push({
title: data[i].title,
id: i + 1,
index: i
});
}
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question