问题标签 [compose-for-web]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
206 浏览

kotlin - 在 Kotlin Compose for Web 中使用 Web 组件库

我想稍微修改一下 Kotlin Compose for Web。在我过去的一些 Web 项目中,我使用了Clarity Design System (CDS)的一些 Web 组件。

在 JavaScript 或 TypeScript 项目中,您首先需要安装 npm 包@cds/core@cds/city. 其次,您必须包含一些全局样式表,例如通过 HTML 或 sass-import。对于您要使用的每个组件,您需要导入相应的register.js. 最后,您可以像任何其他标记一样在 HTML 中包含该组件:

我尝试使用 Kotlin Compose for Web 复制这些步骤,但无法使其正常工作。任何帮助表示赞赏!