Skip to content

组合式setup语法糖法,怎么获取context #9395

Discussion options

You must be logged in to vote
<script lang="ts" setup>
import { getCurrentInstance } from 'vue'
const vm = getCurrentInstance()
console.log(vm)
console.log(vm?.proxy.$attrs)
console.log(vm?.proxy.$slots)
console.log(vm?.proxy.$emit)

</script>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by edison1105
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants