我的超链接标签 ID 在 Svelte 的浏览器上一直显示为文本

My id of an hyperlink tag keeps displaying as text on the browser in Svelte

我一直在尝试使用我对 Restful API 和 svelte 的了解来制作网络应用程序 wiki,但我遇到了一个问题,我为超链接标签提供了每个对象的 ID在数据库中,它可以工作,但问题是它一直在浏览器中将超链接 tag() 的 id 显示为文本。我该如何解决这个问题?

这是结果的直观表示:

代码如下:

<script>
import { onMount } from 'svelte';
import { each } from 'svelte/internal';
import { store } from '$lib/store';

let articles = [];
onMount(async () => {
    const response = await fetch('http://localhost:5000/articles');
    const data = await response.json();
    articles = data;
})

</script>

<div class="container">
    {#each articles as article}
        <a href="/articles/article/{article._id}" id={article._id}>
             {article.title}
            <hr>
        </a>
        {$store = article._id}
    {/each}
</div>

<style>
    a {
        text-decoration: none;
        color: rgb(223, 209, 209);
        font-weight: bold;
        font-size: 1.5rem;
    }

    a::hover {
        text-decoration: underline;
    }

    div {
        margin-top: 90px;
        text-align: center;
    }
</style>

我真的需要帮助T_T

要不显示 ID,您需要删除此行:

{$store = article._id}

这是分配给商店并返回呈现 ID 文本的值。在 Svelte 代码中,这不是正常的事情。通常,您更新脚本块中的数据并在您的模板中呈现它——您的模板不应该对您的数据产生副作用。