Anonymous

Mod Creation/Reusable Components with PetiteVue: Difference between revisions

From Melvor Idle
m
Remove extra paren to fix syntax of line 16.
m (Remove extra paren to fix syntax of line 16.)
Tag: visualeditor
 
Line 245: Line 245:
</template></syntaxhighlight>
</template></syntaxhighlight>


  <syntaxhighlight lang="js" line>// setup.mjs
  <syntaxhighlight lang="js" line="1">// setup.mjs
function Counter(props) {
function Counter(props) {
   return {
   return {
Line 260: Line 260:
     // Save a reference here
     // Save a reference here
     const counter = Counter({ count: 0 });
     const counter = Counter({ count: 0 });
     ui.create(counter), document.getElementById('woodcutting-container'));
     ui.create(counter, document.getElementById('woodcutting-container'));


     // Manipulate here to reflect changes in the UI
     // Manipulate here to reflect changes in the UI
1

edit