As someone who is brand new to Vue, I'm exploring the possibilities. Although it's not something I typically do, I believe achieving a similar outcome in React + JSX (untested) could look like this:
render() {
const el = <p>Blah <a href="https://example.com">bloop</a> bleh</p>
return (
<div>
<CustomReactComponent someProp={el}
</div>
)
}
In this scenario, CustomReactComponent
would be responsible for rendering the element based on this.props.someProp
.
Is there a way to achieve similar functionality using Vue?
For those who are curious, my requirement is akin to the untested React example provided above. I am looking to have certain parent components of a specific small component pass text content to be displayed within it. Additionally, I want the ability to include links wherever necessary, hence I require the presence of <a>
tags. My initial thought was to accomplish this by passing a complete <p>
or <span>
element as a prop.
Any alternative suggestions are appreciated!