Skip to content

Latest commit

 

History

History
42 lines (27 loc) · 892 Bytes

README.md

File metadata and controls

42 lines (27 loc) · 892 Bytes

ES6

This demonstrates how to use ES6 in your tags using the in-browser compiler.

If you use ES6, TypeScript, CoffeeScript, or any JavaScript pre-processor, it will override the one built in to Riot.

That means you will lose the shorthand syntax. So this:

getMessage() { ... }

Becomes (using ES6):

this.getMessage = function () { ... }
// or
this.getMessage = () => { ... }

Please don't use in-browser Babel for production. Read the Riot docs for prebuilt ES6 tags.

Have a play

Open this example on Plunker

Run locally

Install superstatic if you don't have.

$ npm install -g superstatic

Download or clone this repo, then run the command.

$ cd to/this/dir
$ superstatic

Open the URL shown in your browser.