add plugin support/example

This commit is contained in:
Geoff Doty 2024-09-01 10:44:20 -04:00
parent 8a664c07c8
commit 72bb631f81
1 changed files with 11 additions and 1 deletions

View File

@ -2,13 +2,23 @@ import * as riot from "riot";
import app from "./components/app.riot"; import app from "./components/app.riot";
const main = { const main = {
init() {
// start-up actions here // start-up actions here
init() {
// install plugins
this.plugins();
// mount components // mount components
this.mount(); this.mount();
}, },
// extend functionality
plugins() {
riot.install((component) => {
// add your own features here
component.version = "3.0.0";
});
},
mount() { mount() {
// register core app component // register core app component
riot.register("app", app); riot.register("app", app);