Skip to content

How to get all props in setup? #9879

Discussion options

You must be logged in to vote

You can try using the following two methods:

<script lang="ts" setup>
const attrs = useAttrs()
console.log(attrs)
</script>

or

<script lang="ts">
export default defineComponent({
  setup(_, { attrs }) {
    console.log(attrs)
  }
})
</script>

Replies: 1 comment

Comment options

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