Scala.js bindings for Vue.js and an example application
To use as a library, just pull in from
To get started, run
sbt ~fastOptJS in this example project.
Obviously you need to have SBT installed.
If you open localhost:12345/target/scala-2.12/classes/index-dev.html in your browser, it will show you a sample app, doing various bindings and Scala code. Its not meant to be pretty, simply instructive. Do open the Console to see debug messages.
If you change your source HTML (inside
/src/main/resources) or Scala (inside
/src/main/scala/example/Todo.scala, sbt will recompile as needed.
You then just have to refresh the page to see the new version. Hopefully having an example application will make it clearer on how to use Vue from Scala, i.e. monkey see, monkey do.
The optimized version
sbt fullOptJS and open up
index-opt.html for an optimized version
of the final application, useful for final publication. You may well need to copy over
index-dev.html to get your latest changes. Be sure to refer to the correct JS as well, as it will have a different name than the fast compiled version. e.g.
This is just a quick proof of concept and some bindings for those wanting to use Vue.js from Scala.js. Feel free to get in contact with any issues etc.