就是獲取那個帶router-link-active類名的元素,通過dom操作倒是可以獲取到,我想問一下有沒有vue的方法? created() { this.$nextTick(() => { let activeElement = document.querySelector('.router-link-active') }) }
vue-router如何在組件初始化的時候獲取激活的路由元素?
呼啦一陣風(fēng)
2019-03-15 18:14:10