💾 Archived View for gmi.noulin.net › gitRepositories › moonjsExamples › file › showHide.html.gmi captured on 2023-07-10 at 18:07:33. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-01-29)
-=-=-=-=-=-=-
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>