I am submitting form data using the following vue code
<postreview :attributes="{{ $brand }}" inline-template v-cloak>
<div class="panel-body">
<div v-if="editing">
<div class="form-group">
<star-rating v-model="rating" :star-size="20"></star-rating>
<textarea class="form-control" v-model="body" placeholder="Say somethijng"></textarea>
</div>
<button class="btn btn-xs btn-primary" @click="post">Review</button>
</div>
<div v-else>
<div>
thanks for posting!
</div>
</div>
</div>
</postreview>
and my vue file
<script>
export default {
props: ['attributes'],
data() {
return {
editing: true,
rating:this.attributes.rating
};
},
methods: {
post() {
axios.post('/brands/' + this.attributes.slug + '/reviews', {
body: this.body,
rating: this.rating
});
this.editing = false;
flash('Updated!');
}
}
}
</script>
The issue is my page loads the rating using a foreach with laravel. So after I submit, the page won't show my new review unless I reload it. I tried looking online for a way to have Vue reload the page but I couldn't find one (which seems crazy).
Is there a way to reload the page after submitting through vue?
Thanks!