0
我有一個Play客戶機和服務器部件的Play框架項目。客戶端部分使用scala.js。我試圖在客戶端腳本中使用scalatags。爲Play框架項目添加圖形標記
在項目的build.sbt中,我添加了"com.lihaoyi" %% "scalatags" % "0.5.5"
到libraryDependencies。 IntelliJ然後給我正確的代碼完成scalatags類型。該頁面如下:
package app
import scala.scalajs.js
import org.scalajs.dom
import scalatags.Text.all._
object App extends js.JSApp {
def main(): Unit = {
dom.document.getElementById("scalajsShoutOut").innerHTML = h1("Hello").render
}
}
然而,請求頁面時,我得到編譯器錯誤:
[error] Referring to non-existent class scalatags.Text$all$
[error] called from app.App$.main()scala.Unit
[error] called from scala.scalajs.js.JSApp$class.$$js$exported$meth$main(scala.scalajs.js.JSApp)java.lang.Object
[error] called from app.App$.$$js$exported$meth$main()java.lang.Object
[error] called from app.App$.main
[error] exported to JavaScript with @JSExport
[error] involving instantiated classes:
[error] app.App$
etc.
需要什麼其他的設置嗎?
謝謝你的。確實簡單的構建工具。 – devx