I'm currently facing difficulties while trying to access an API in order to retrieve data. As a novice in the world of vue.js
and javascript
, I encountered an error message saying
Uncaught SyntaxError: Invalid shorthand property initializer
. Unfortunately, I am unable to decipher the meaning or implications of this error.
<body>
<div id="vue-app">
{{ articles }}
</div>
<body>
var article = new Vue({
el: '#vue-app',
data: {
articles = ''
},
created: function () {
this.fetchData();
},
methods: {
fetchData: function () {
var that = this
this.$http.get('localhost/aim-beta/rest/export/json/article'),
function (data) {
vm.articles = data.main.temp;
}
}
}
});