API Reference
Official API documentation for developers building with the eklbaoa framework.
Core APIs
Importing:
import { createApp, defineComponent, ref } from 'eklbaoa'
createApp(rootComponent)
createApp({ ComponentDefinition }) ➜ Application
Creates a new eklbaoa application instance.
Example:
const app = createApp(AppComponent)
app.mount('#app')
Component API
defineComponent(options)
defineComponent({
template: HTMLString,
data: Function | Object,
props: Object,
methods: Object,
computed: Object
}) ➜ ComponentDefinition
template: Required string template for the component
data: Component state object or factory function
props: Array or object of properties to accept
Example:
const Button = defineComponent({
template: '<button>{{ label }}</button>',
props: ['label', 'onClick']
})
Router API
createRouter(options)
createRouter({
routes: Array<Route>,
history: HistoryMode
}) ➜ RouterInstance
routes: Array of route definitions with path and component
history: 'hash' or 'html5' history mode
Example:
const router = createRouter({
routes: [
{ path: '/', component: Home },
{ path: '/about', component: About }
],
history: 'html5'
})
Utility Functions
ref(value)
ref(T) ➜ RefObject<T>
Creates a reactive reference to a value (primitives only).
computed(fn)
computed(() ➜ T) ➜ RefObject<T>
Creates derived state that automatically updates when dependencies change.