mirror of https://github.com/sveltejs/svelte
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
292 B
22 lines
292 B
3 years ago
|
<script>
|
||
|
export let tags = [
|
||
|
{
|
||
|
name: 'Red',
|
||
|
color: '#FF0000'
|
||
|
},
|
||
|
{
|
||
|
name: 'Green',
|
||
|
color: '#00FF00'
|
||
|
},
|
||
|
{
|
||
|
name: 'Blue',
|
||
|
color: '#0000FF'
|
||
|
}
|
||
|
];
|
||
|
</script>
|
||
|
|
||
|
{#each tags as tag}
|
||
|
{@const tagColor = tags.find(t => t.name === tag.name).color}
|
||
|
<p>{tagColor}</p>
|
||
|
{/each}
|