From 72bb631f810f0eda570192c358110e56bf98b42d Mon Sep 17 00:00:00 2001 From: Geoff Doty Date: Sun, 1 Sep 2024 10:44:20 -0400 Subject: [PATCH] add plugin support/example --- src/main.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index 7c4a456..8187704 100644 --- a/src/main.js +++ b/src/main.js @@ -2,13 +2,23 @@ import * as riot from "riot"; import app from "./components/app.riot"; const main = { + // start-up actions here init() { - // start-up actions here + // install plugins + this.plugins(); // mount components this.mount(); }, + // extend functionality + plugins() { + riot.install((component) => { + // add your own features here + component.version = "3.0.0"; + }); + }, + mount() { // register core app component riot.register("app", app);