How to redirect after submitting a post request in vue-template?

nativescriptcore

#1

I am using vue-template in native script. I have a form which is submitting successfully. I want to redirect it after getting response from server. How can I do that? My code is as below

saveBill:function() { http.request({ url: "https://example.com/api/bill/add", method: "POST", headers:
	{ "Content-Type": "application/json" }, content: JSON.stringify({ username: this.username, amount:this.amount,remark:this.remark,date:this.date
	}) }).then(response => {  }, error => { console.error(error); }); }, },

#2

Once you get the response, simply navigateTo whichever page you like to, clear the history if required.


#3

Thank you for your quick reply.

I have try to use that.

saveBill:function() { http.request({ url: "https://mess-room3.herokuapp.com/api/bill/add", method: "POST", headers:
	{ "Content-Type": "application/json" }, content: JSON.stringify({ username: this.username, amount:this.amount,remark:this.remark,date:this.date
	}) }).then(response => { this.$navigateTo() }, error => { console.error(error); }); }, },

I want to redirect to different component. So want will be the value pass to navigateTo method