Giter VIP home page Giter VIP logo

scalajs-vue's Introduction

scalajs-vue Logo

scalajs-vue

Scala.js bindings for Vue.js and an example application

To use as a library, just pull in from

https://jitpack.io/#fancellu/scalajs-vue

Build Status

Example app showing the use of Scala.js with Vue.js The bindings for Vue.js are in com.felstar.scalajs.vue

Get started

To get started, run sbt ~fastOptJS in this example project.

Obviously you need to have SBT installed.

This should download dependencies and prepare the relevant javascript files. It then kicks off a web server to serve the html and JS files.

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.

Demo

live demo

Development

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

Run 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.

<script type="text/javascript" src="../scala-js-vue-js-example-opt.js"></script>

Status

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.

scalajs-vue's People

Contributors

fancellu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scalajs-vue's Issues

Simpler Example

Could you provide a simple example of manipulating data in your methods on an event handler?

For someone who is familiar with Vue.js but new to Scala, this is a bit too complicated.

Suggested Improvements

I'd suggest adding a bit of clarification in your example with the following:

  • Using lifecycles

  • Using a case of a template with data and methods and not just props and template

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.