import {watch} from 'vue'
import {useRoute} from  'vue-router'

const route = useRoute()

watch(route, () => {
    console.log('路由发生了变化')
    console.log(window.location.href) //当前导航栏路径
    console.log(route.currentRoute.value.path)	//这个更健康,更精简
})