视频会议

This commit is contained in:
wangqiong
2024-01-18 10:46:33 +08:00
parent d7f5ce05ea
commit 37a88df277
28922 changed files with 2797396 additions and 19461 deletions
+34
View File
@@ -0,0 +1,34 @@
import {
getCurrentInstance,
shallowReactive,
effectScope
} from 'vue'
import { throwNoCurrentInstance } from './utils'
export function useRouter () {
if (process.env.NODE_ENV !== 'production') {
throwNoCurrentInstance('useRouter')
}
return getCurrentInstance().proxy.$root.$router
}
export function useRoute () {
if (process.env.NODE_ENV !== 'production') {
throwNoCurrentInstance('useRoute')
}
const root = getCurrentInstance().proxy.$root
if (!root._$route) {
const route = effectScope(true).run(() =>
shallowReactive(Object.assign({}, root.$router.currentRoute))
)
root._$route = route
root.$router.afterEach(to => {
Object.assign(route, to)
})
}
return root._$route
}