💾 Archived View for gmi.noulin.net › gitRepositories › moonjsExamples › file › showHide.html.gmi captured on 2024-07-09 at 02:34:12. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-01-29)

-=-=-=-=-=-=-

moonjsExamples

Log

Files

Refs

README

showHide.html (537B)

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