/* eslint-disable eol-last */
<template>
<div id="app">
<ul>
<li v-for="item in items"> /* this list is not displaying */
{{ item.id }}
</li>
</ul>
</div>
</template>
<script>
export default {
name: 'app',
data: {
items: []
},
created () {
this.fetchData()
},
methods: {
fetchData () {
this.$http.get('http://url/api/users')
.then(result => {
this.items = result.data
})
}
}
}
</script>
this list is not displaying i am unable to print this in template. Json returns data but could not access in template.please guide me. Where i am making mistake.
debugger;beforethis.items = result.dataand inspectingresult.data. Its an array as expected?