Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SPA実装最前線 ~今どきのJSフレームワーク選び~

SPA実装最前線 ~今どきのJSフレームワーク選び~

2017/10/14 上越TechMeetup #1 の資料です。

Yohei Isokawa

October 15, 2017
Tweet

More Decks by Yohei Isokawa

Other Decks in Programming

Transcript

  1. -> <Hello message="Hello world!" /> import React from 'react'; class

    Hello extends React.Component { render() { return ( <div className="hello"> <h1>{this.props.message}</h1> </div> ); } }
  2. w ίϯϙʔωϯτࢦ޲ @Component({ selector: 'my-app', template: ` <h1>{{title}}</h1> ` })

    export class AppComponent { title = 'Hello world!'; } <my-app></my-app>
  3. export class HeroesComponent implements OnInit { count: number; heroes: Hero[];

    selectedHero: Hero; constructor(private heroService: HeroService) { } ngOnInit() { this.getHeroes(); } getHeroes(): void { this.heroService.getHeroes().then( heroes => this.heroes = heroes ); } }
  4. w ίϯϙʔωϯτࢦ޲ <template> <div class="hello"> <h1>{{ msg }}</h1> </div> </template>

    <script> export default { name: 'hello', data () { return { msg: 'Welcome to Your Vue.js App' } } } </script> <hello></hello>
  5. w TDSJQUλάͰ௚઀ಡΈࠐΊΔ <div id="app"> <p>{{ message }}</p> </div> <script> var

    app = new Vue({ el: '#app', data: { message: 'Hello Vue.js!' } }); </script>
  6. w ୯ҰϑΝΠϧίϯϙʔωϯτ <template> <div id=“app”>…</div> </template> <script> export default {

    name: 'app' } </script> <style> #app { font-family: 'Avenir', Helvetica, Arial, sans-serif; } </style>
  7.  ϓϩδΣΫτͷେ͖͞͸ʁ  ͲΕ΄ͲͷظؒͰϝϯςφϯεͰ͖Δ͔ʁ  ͢΂ͯͷػೳΛ͸͡ΊʹఆٛͰ͖Δ͔ɺͦΕͱ΋ॊೈੑΛ࣋ͨͤΔ Α͏ཁٻ͞Ε͍ͯΔ͔  ͢΂ͯͷػೳ͕ఆٛ͞Ε͍ͯΔͳΒɺͲΜͳػೳɾೳྗ͕ඞཁ͔ʁ 

    υϝΠϯϞσϧ΍ϏδωεϩδοΫ͸ෳࡶ͔ʁ  8FC͔ϞόΠϧ͔σεΫτοϓ͔ɺͲͷΑ͏ͳϓϥοτϑΥʔϜ͕ λʔήοτ͔ʁ  αʔόʔαΠυϨϯμϦϯά͕ඞཁ͔ʁ4&0͸ॏཁ͔ʁ  ϦΞϧλΠϜΠϕϯτΛଟ͘ѻ͏͔ʁ  ϓϩδΣΫτνʔϜͷਓ਺͸ʁ  νʔϜͷ։ൃऀͨͪͷܦݧ஋͸ʁͲͷΑ͏ͳܦྺͳͷ͔ʁ  ͦͷ··͙͢ʹ࢖͑ΔίϯϙʔωϯτϥΠϒϥϦʔ͸ͳ͍͔ʁ ൑அج४Λ΋͓ͬͯ͘