LoginSignup
0
0

More than 5 years have passed since last update.

Riotを使ってランダムの数値を作成する

Last updated at Posted at 2016-06-05

React, Polymerなどと比較されるRiotを使ってみた。

公式で発表されている数値などによると、Riotはミニマムで、かつ早いらしいです。

Riot vs React & Polymer

そして、コードの構造が言語ごとに分けて書き出せるため、非常に分かりやすい書き方ができます。

<example-tag>
  <p id="findMe">Do I even Exist?</p>
  <p>Is this real life?</p>
  <p>Or just fantasy?</p>

  <script>
  this.on('mount', function(){
    // Contexted jQuery
    $('p', this.root)

    // Contexted Query Selector
    this.root.querySelectorAll('p')
  })
  </script>
</example-tag>

次に、exampleを元に実際使ってみます。webpackでビルド, プレビューします。

$ git clone https://github.com/riot/examples riot-examples
$ cd riot-examples/webpack
$ npm i
$ ./dev.sh

$ chromium http://localhost:3000/

内容はRandom number generatorです。ボタンクリックで作成します。

$ npm i riot -g
$ cd app
$ riot logs.tag
$ riot random.tag
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0