defineRuntimePlugin #
Declares a Runtime Plugin, which runs in the browser and while pages are rendered on the server. It only adds types.
Usage #
TypeScript
import { defineRuntimePlugin } from 'kawapress'
export default defineRuntimePlugin({
name: 'my-runtime-plugin',
setup(api) {
api.router((router) => {
console.log(router.currentRoute.value.path)
})
},
})Parameters
pluginRuntimePlugin
The plugin: a name and a setup(api) that registers hooks.
namestring
Stable name of the plugin.
setupRuntimePluginSetup
Registers the hooks of the plugin.
Returns The same plugin.
Full type signature
TypeScript
function defineRuntimePlugin(plugin: RuntimePlugin): RuntimePlugin

Comments