moonjsExamples

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

eventListener.html (383B)


      1 <body>
      2 <script src="https://unpkg.com/moonjs"></script>
      3 <div id="app7">
      4   <p>{{count}}</p>
      5   <button m-on:click="increment">Increment</button>
      6 </div>
      7 <script>
      8 const app7 = new Moon({
      9   el: "#app7",
     10   data: {
     11     count: 0
     12   },
     13   methods: {
     14     increment: function() {
     15       // Increment the count by one
     16       this.set('count', this.get('count') + 1);
     17     }
     18   }
     19 });
     20 </script>
     21 </body>