91
edits
Buttchouda (talk | contribs) |
Buttchouda (talk | contribs) |
||
Line 377: | Line 377: | ||
''This topic is covered in greater detail in [[Mod Creation/Reusable Components with PetiteVue]].'' | ''This topic is covered in greater detail in [[Mod Creation/Reusable Components with PetiteVue]].'' | ||
Melvor Idle ships with [https://github.com/vuejs/petite-vue | Melvor Idle ships with [https://github.com/vuejs/petite-vue PetiteVue] for mods to use to create reusable HTML components. You can use documentation from the [https://github.com/vuejs/petite-vue official GitHub page] to assist in using the PetiteVue library. However, there are some helper functions for making it easier for mods to interact with. | ||
=== Import HTML Templates === | === Import HTML Templates === | ||
Line 407: | Line 407: | ||
=== Defining a Component === | === Defining a Component === | ||
Using the [https://github.com/vuejs/petite-vue#components | Using the [https://github.com/vuejs/petite-vue#components PetiteVue documentation on components], you should define each component as a function. This component should define its template selector using the <code>$template</code> property, and then any additional properties or methods that the rendered component will use. For example: | ||
<nowiki>function Counter(props) { | <nowiki>function Counter(props) { |
edits