首页 > 解决方案 > 为什么它不知道相同的内容?

问题描述

我已经用相同的 ui 用 svelte 和 sapper 构建了一个示例应用程序,并发现内容看起来不同:

苗条 在此处输入图像描述

工兵 在此处输入图像描述

我检查了css,但应该没有任何区别。
来自https://gitlab.com/oceanstack/ui5-sapperhttps://gitlab.com/oceanstack/ui5-svelte的代码

标签: sveltesappersapui5

解决方案


问题是你的 HTML 不一样。

苗条:

<ui5-label id="myLabel" for="myInput" required show-colon="">First name</ui5-label>

工兵:

<ui5-label id="myLabel" for="myInput" show-colon="">First name</ui5-label>

请注意,Svelte 具有该required属性,而 Sapper 则没有。

If you go into the browser development tools on the Sapper page and add the required attribute to the label, you'll notice that all of a sudden, the ellipsis is removed and that your labels will match.


推荐阅读