using CoffeeScript2 in vue project. write less code, better code.
-
init project:
npx @fine.sh/cs init -
start:
npm start
-
render for JSX:
# data: () => ({ count: 0 }) data: -> count: 0 # handle: function() { this.count = this.count + 5 } handle: -> @count = @count + 5 # '@' is 'this' <button on-click={@handle}>click me: {@count}</button><br/> -
render with methods:
# hello: function(h) { return (<span>hello world.</span>) } hello: (h) -> <span>hello world.</span> <p>{@hello(h)}</p>