Answer the question
In order to leave comments, you need to log in
Vue data output from google spreadsheet, how to get to the right data?
Hello, I want to get the name of the goods and prices (old and new price) from Google tables.
The plate looks like this.
Here is the Json of the plate
https://spreadsheets.google.com/feeds/list/1iuJBDWtadHG4RHxUHhGcgdpmY_dffjLgWyRsf01mHAY/1/public/values?alt=json
new Vue({
el: '#test',
data() {
return {
info: null
};
},
mounted() {
axios
.get('https://spreadsheets.google.com/feeds/list/1iuJBDWtadHG4RHxUHhGcgdpmY_dffjLgWyRsf01mHAY/1/public/values?alt=json')
.then(response => (this.info = response));
}
});
<div class="" id="test">
<div v-for="item in info">
{{ item.title }}
</div>
</div>
<div class="" id="test">
{{ info }}
</div>
Answer the question
In order to leave comments, you need to log in
data: () => ({
info: null,
columns: [
{ title: 'title', key: 'title' },
{ title: 'old price', key: 'gsx$oldprice' },
{ title: 'new price', key: 'gsx$newprice' },
],
}),
mounted() {
axios
.get('https://spreadsheets.google.com/feeds/list/1iuJBDWtadHG4RHxUHhGcgdpmY_dffjLgWyRsf01mHAY/1/public/values?alt=json')
.then(r => this.info = r.data.feed.entry);
},
<table>
<thead>
<tr>
<th v-for="col in columns">{{ col.title }}</th>
</tr>
</thead>
<tbody>
<tr v-for="item in info">
<td v-for="col in columns">{{ item[col.key].$t }}</td>
</tr>
</tbody>
</table>
axios
.get('https://spreadsheets.google.com/feeds/list/1iuJBDWtadHG4RHxUHhGcgdpmY_dffjLgWyRsf01mHAY/1/public/values?alt=json')
.then(response => {
this.info = response.data.feed.entry
});
<div v-for="item in info">
{{ item.title['$t'] }}
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question