add plugin support/example
This commit is contained in:
parent
8a664c07c8
commit
72bb631f81
12
src/main.js
12
src/main.js
|
@ -2,13 +2,23 @@ import * as riot from "riot";
|
|||
import app from "./components/app.riot";
|
||||
|
||||
const main = {
|
||||
init() {
|
||||
// start-up actions here
|
||||
init() {
|
||||
// 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);
|
||||
|
|
Loading…
Reference in New Issue