App lifecycle
registerApp(component)
Call registerApp once from the application's JavaScript entry. Each native window scene receives a new controller and a separate Vue app instance.
ts
import { registerApp } from '@rafaelaugusto/nitroui-vue'
import App from './App.generated'
registerApp(App)mount(component, controller)
Use mount when your host already owns the NitroUI controller. The function returns the mounted Vue app. Hold onto it for the lifetime of that screen, then call unmount() when the screen is disposed.
ts
import { mount } from '@rafaelaugusto/nitroui-vue'
import type { ViewController } from 'nitro-ui-renderer/hybrids'
import Profile from './App.generated'
export function attachProfile(controller: ViewController) {
const app = mount(Profile, controller)
return () => app.unmount()
}Unmounting detaches the native subtree and releases the input and controller listeners.