moonjsExamples

moonjs example (from tutorial)
git clone https://noulin.net/git/moonjsExamples.git
Log | Files | Refs | README

onInput.html (430B)


      1 <body>
      2 <script src="https://unpkg.com/moonjs"></script>
      3 <div id="app">
      4   <p>{{count}} <input type='text' placeholder='type something here...' m-model="inputvar" m-on:input="keyup"></p>
      5   <p>{{inputvar}}</p>
      6 </div>
      7 <script>
      8 const app7 = new Moon({
      9   el: "#app",
     10   data: {
     11     count: 0,
     12     inputvar: ''
     13   },
     14   methods: {
     15     keyup: function() {
     16       this.set('count', this.get('inputvar').length);
     17     }
     18   }
     19 });
     20 </script>
     21 </body>