问题
Binding.scala's examples contain Scala XML tags as a language to code DOM fragments. Can scalatags be used instead?
回答1:
Binding.scala internally generates very sophisticated ScalaTags code. On the other hand, manually written naive ScalaTags code recreates entire DOM whenever the data changes.
Milad Khajavi created an example demonstrating the problem of the manually written ScalaTags code: https://gitter.im/ThoughtWorksInc/Binding.scala?at=581b6367eed0c3125f30d57b
ScalaTags is very convenient for simple application. However, since they are plain function calls that do not have any ability to partially update, ScalaTags is not a good choice for a complex interactive application if you need fine-grained update on DOM.
来源:https://stackoverflow.com/questions/42893721/can-scalatags-be-used-together-with-binding-scala