如何在ScalaJS项目中使用PrimeReact UI组件集合?

时间:2019-05-04 08:42:14

标签: sbt scala.js scalajs-react primereact

我有一个简单的Create React Scala App,并且想要构造一个数据表。我尝试将 DataTable primereact library component 实施到App.scala。

...
import scala.scalajs.js
import scala.scalajs.js.annotation.{JSImport, ScalaJSDefined}
import scala.primereact.datatable.{DataTable}


@JSImport("resources/App.css", JSImport.Default)
@js.native
object AppCSS extends js.Object
... 

但是不能编译。 这是build.sbt文件

npmDependencies in Compile += "react" -> "16.8.6"
npmDependencies in Compile += "react-dom" -> "16.8.6"
npmDependencies in Compile += "react-proxy" -> "1.1.8"

npmDevDependencies in Compile += "file-loader" -> "3.0.1"
npmDevDependencies in Compile += "style-loader" -> "0.23.1"
npmDevDependencies in Compile += "css-loader" -> "2.1.1"
npmDevDependencies in Compile += "html-webpack-plugin" -> "3.2.0"
npmDevDependencies in Compile += "copy-webpack-plugin" -> "5.0.2"
npmDevDependencies in Compile += "webpack-merge" -> "4.2.1"
npmDevDependencies in Compile += "primereact" -> "3.0.0"
npmDevDependencies in Compile += "primeicons" -> "1.0.0"

如何配置build.sbtApp.scala以与主要反应一起使用? 在React Scala App中还有其他组件库可以工作吗?

0 个答案:

没有答案