💾 Archived View for gmi.noulin.net › gitRepositories › moonjsExamples › file › methods.html.gmi captured on 2023-07-10 at 18:07:29. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-01-29)

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

moonjsExamples

Log

Files

Refs

README

methods.html (435B)

     1 <body>
     2 <script src="https://unpkg.com/moonjs"></script>
     3 <div id="app3">
     4   <p>{{reverse(msg)}}</p>
     5 </div>
     6 <script>
     7 const app3 = new Moon({
     8   el: "#app3",
     9   data: {
    10     msg: "Hello Moon!"
    11   },
    12   methods: {
    13     changeMessage: function(msg) {
    14       this.set('msg', msg);
    15     },
    16     reverse: function(str) {
    17        return str.split("").reverse().join("");
    18     }
    19   }
    20 });
    21 app3.callMethod('changeMessage', ['New Message!']);
    22 </script>
    23 </body>