为什么它不起作用?列表不显示,求助
<template>
<div>
<h3>Available talks</h3>
<div v-for="item in items">
<p>{{item.title}} by <strong>{{item.userId}}</strong></p>
</div>
</div>
</template>
<script>
export default {
data() {
return {
items:[]
}
},
created: function () {
this.fetchData();
},
methods: {
fetchData: function () {
this.$http.get( 'https://jsonplaceholder.typicode.com/posts', function( data ) {
this.items = data;
}); } } }
</script>
<style>
</style>