<!-- index.html -->
<div id="app"></div>
<script type="module" src="app.js"></script>
// app.js
import { initApp } from './framework/app/init.js';
initApp({
root: '#app',
routes: {
home: 'home',
clientes: 'clientes',
},
fallback: 'home',
dev: true,
});
// modules/home/home.js
import { defineModule } from '../../framework/module/module.js';
defineModule({
state: () => ({ count: 0 }),
methods: {
increment(ctx) {
ctx.state.count++;
},
},
});
<!-- modules/home/home.html -->
<h1>Count: <span data-bind="count"></span></h1>
<button data-click="increment">+1</button>