I've been learning and practicing Stencil JS and I'm creating a card component. I have several props that are meant to populate the card's content. While the card and its styling show up fine when I render the page the card does now show any of the props I passed through.
The Components code...
import { Component, Host, h, Prop } from '@stencil/core';
@Component({
tag: 'proj-slider',
styleUrl: 'proj-slider.css',
shadow: true
})
export class ProjSlider {
@Prop() cardImage: string;
@Prop() title: string;
@Prop() link1: string;
@Prop() linkText1: string;
@Prop() link2: string;
@Prop() linkText2: string;
render() {
return (
<div class="maincont">
<div class="maintext">
<img src={this.cardImage}/><br/>
{this.title}
</div>
<div class="linkbox">
<div class="link"><a href={this.link1}>{this.linkText1}</a>
</div>
<div class="link"><a href={this.link2}>{this.linkText1}</a>
</div>
</div>
</div>
);
}
}
The Call to the Component in the JSX of another Component.
<proj-slider cardImage="https://i.imgur.com/NPV7bmk.png" title="Calculator" link1="alexmercedcoder.com" linkText1="git"
link2="alexmercedcoder.com" linkText2="live"></proj-slider>
The code as it stands show the card and doesn't throw any errors but doesn't display the content from the props.