If you are using vue-router
, you should use router.go(path)
to navigate to any particular route. The router can be accessed from within a component using this.$router
.
Otherwise, window.location.href = 'some url';
works fine for non single-page apps.
EDIT: router.go()
changed in VueJS 2.0. You can use router.push({ name: "yourroutename"})
or just router.push("yourroutename")
now to redirect.
P.S: In controllers use: this.$router.push({ name: 'routename' })