为什么它不知道相同的内容?

时间:2020-03-18 13:23:29

标签: svelte sapper sapui5

我已经在svelte和sapper中使用相同的ui构建了一个示例应用程序,并弄清楚了,内容似乎有所不同:

苗条 enter image description here

拍手 enter image description here

我已经检查过CSS,但这应该没有任何区别。
https://gitlab.com/oceanstack/ui5-sapperhttps://gitlab.com/oceanstack/ui5-svelte

中的代码

1 个答案:

答案 0 :(得分:2)

问题是您的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没有。

如果进入Sapper页面上的浏览器开发工具并将required属性添加到标签,您会发现突然之间省略号被删除并且标签将匹配。 / p>