feat: 联调登录+对话
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { getCurrentInstance } from 'vue'
|
||||
|
||||
type OpenProfileEmit = (event: 'open-profile') => void
|
||||
|
||||
export function createProfileOpener(emit: OpenProfileEmit) {
|
||||
const instance = getCurrentInstance()
|
||||
const hasOpenProfileListener = Boolean(instance?.vnode.props?.onOpenProfile)
|
||||
|
||||
return function openProfile() {
|
||||
if (hasOpenProfileListener) {
|
||||
emit('open-profile')
|
||||
return
|
||||
}
|
||||
|
||||
uni.navigateTo({
|
||||
url: '/pages/profile/profile'
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user