How to get all props in setup? #9879
Answered
by
Alfred-Skyblue
anhnhoktvn
asked this question in
Help/Questions
-
I'd like to get all props in inside setup section without declare all of its props. |
Beta Was this translation helpful? Give feedback.
Answered by
Alfred-Skyblue
Dec 20, 2023
Replies: 1 comment
-
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> |
Beta Was this translation helpful? Give feedback.
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
You can try using the following two methods:
or