Skip to content

如何在普通js文件中获取vue3实例 #7945

Answered by miiky
xhc-code asked this question in Help/Questions
Discussion options

You must be logged in to vote

import { getCurrentInstance } from ‘vue’
const instance = getCurrentInstance()

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@xhc-code
Comment options

@alamhubb
Comment options

Answer selected by xhc-code
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@xhc-code
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants