Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

176
Views
Is there any way to pass a DOM element as a prop in Vue 3?

I'm super new to Vue. While I don't normally do this, I think something like this would be possible in React + JSX (untested):

render() {
  const el = <p>Blah <a href="https://example.com">bloop</a> bleh</p>
  return (
    <div>
      <CustomReactComponent someProp={el}
    </div>
  )
}

Where CustomReactComponent would be able to render the element out of this.props.someProp.

Can I achieve this in Vue?


For the curious, my use case is similar to my very untested React example above. I would like some, but not all parent components of a common tiny component to pass in some text to display somewhere. Except I'd like to include links wherever I please, so I need <a> tags in there. I figured I could make that work by passing a whole <p> or <span> element as a prop.

Alternate solutions welcome!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

As Estus said in their comment, this is what the slots feature is for.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!