我是 Svelte 的新手,当用户导航到新页面时,我正在尝试将动画应用于我的页面内容。然而,动画导致我的整个网站在动画期间复制。
我的内容如下所示:
<div class="entire-page">
<nav>
<ul>
<li> Navigation items </li>
<li> Navigation items </li>
<li> Navigation items </li>
</ul>
</nav>
<div class="content" in:slideIn out:slideOut>
Here is my first page content. This is supposed to slide in / out.
</div>
</div>
但是,当动画执行时。它复制了所有内容(即.整个页面):这是我的浏览器中的结果,直到动画消失:
<div class="entire-page">
<nav>
<ul>
<li> Navigation items </li>
<li> Navigation items </li>
<li> Navigation items </li>
</ul>
</nav>
<div class="content" in:slideIn out:slideOut>
Here is my first page content. This is supposed to slide in / out.
</div>
</div>
<div class="entire-page">
<nav>
<ul>
<li> Navigation items </li>
<li> Navigation items </li>
<li> Navigation items </li>
</ul>
</nav>
<div class="content" in:slideIn out:slideOut>
Here is my second page content. This is supposed to slide in / out.
</div>
</div>
这是由于缺少对元素的引用吗?