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

one case of how to begin vuejs

wtnabe
December 16, 2017

one case of how to begin vuejs

Kanazawa.rb meetup #64 で紹介した Vue.js の始め方

wtnabe

December 16, 2017
Tweet

More Decks by wtnabe

Other Decks in Programming

Transcript

  1. Vue.js ES 5 compat ( since IE 10 / iOS

    6 / Android 4.4 ) Progressive JavaScript Framework React AngularJS 1 React JS-centric AngularJS 1 Web Components-centric ( Google ) template
  2. Component React Single File Component <template>, <script>, <style> Scoped CSS

    Shadow DOM ( Web Components ) {{ }} placeholder @ v- directive ViewModel
  3. React class HelloMessage extends React.Component { render() { return (

    <div> Hello {this.props.name} </div> ); } } JavaScript JSX
  4. AngularJS 1 <html ng-app> ... <div> <label>Name:</label> <input type="text" ng-model="yourName"

    placeholder="Enter a name here"> <hr> <h1>Hello {{yourName}}!</h1> ng-directive
  5. Vue.js v2 <template> <p>{{ greeting }} World !</p> </template> <script>

    export default { data() { greeting: 'Hello' } } </script> JavaScript
  6. template // Define a new component called todo-item Vue.component('todo-item', {

    template: '<li>This is a todo</li>' }) Single File Component
  7. Vue warn var app = new Vue({ el: '#app', data:

    { message: 'Hello Vue!' } })
  8. var app = new Vue({ el: '#app', data: function() {

    return { message: 'Hello Vue!'; } } })