【发布时间】:2017-02-02 17:27:14
【问题描述】:
scalatags.Text.all._ 和 scalatags.JsDom.all._ 包的区别和用途是什么?
在official scalatags tutorial你可以阅读:
// import scalatags.Text.all._
// OR
// import scalatags.JsDom.all._
html(
head(
script(src:="..."),
script(
"alert('Hello World')"
)
),
body(
div(
h1(id:="title", "This is a title"),
p("This is a big paragraph of text")
)
)
)
And turns them into HTML like this:
<html>
<head>
<script src="..."></script>
<script>alert('Hello World')</script>
</head>
<body>
<div>
<h1 id="title">This is a title</h1>
<p>This is a big paragraph of text</p>
</div>
</body>
</html>
【问题讨论】: