Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

How to access props in "extended" component #8264

Unanswered
incutonez asked this question in Help/Questions
Discussion options

Let's say I have 2 components: CompBase and CompExt. CompExt is basically a "pass-through"/extended component of CompBase, where its props are the same as CompBase. However, in CompExt, I need to access the props to do some additional logic. e.g. this example

I can obviously redefine the props, but then I'd have to add a v-bind="$props" in the template, which feels wrong. e.g. this example

I could also try accessing useAttrs, but then the props aren't formally processed yet... isUpdate: true would come in as is-update: "", and obviously I don't have proper typing or auto completion in my IDE.

So what would be the "proper" way to do what I'm trying to do?

You must be logged in to vote

Replies: 1 comment

Comment options

See vuejs/rfcs#477. Discussion is welcome.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.