php - I have problem in show item of database with v-for in vue.js
Get the solution ↓↓↓I have problem in show item of database with v-for. I get data from database and show it in console log but isn't show in app.vue .
app.vue
<template>
<div class="container">
<div class="row well">
<div id='app'><input type='button' @click='allRecords()' value='Select All newss'>
<div class="col-sm-3 alert-success p" v-for="news in newss" :key="news">
<p>{{ news.news_num }}</p>
<p>{{ news.news_title }}</p>
<p>{{ news.news_description }}</p>
<p>{{ news.news_year }}/{{ news.news_month }}/{{ news.news_day }}</p>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
newss: [],
newsid: 0,
};
},
methods: {
allRecords: function() {
axios.get('/api.php')
.then(function(response) {
app.newss = response.data;
console.log(app.newss);
})
.catch(function(error) {
console.log(error);
});
}
}
}
</script>
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: xmlhttprequest error flutter
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.