Vue single page F5 refresh, how to get the current routing address

console.log (this.$router.path) can"t get, undefined

Mar.17,2021

is this.$route.path , not this.$router.path ;
using vue-router is router , and obtaining the relevant route is route ;


window.location.pathname learn about


add an name attribute to all your configured routes
get name

< hr class= "answer.

watch: {

$route() {
    console.log(this.$route.path)
}

}
this way you can get it, and sometimes this.$route.path can't get the exact

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e59558-4551f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e59558-4551f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?