@flightdev/ui-petite-vue
v1.1.0
Published
Petite-vue adapter for Flight Framework
Readme
@flightdev/ui-petite-vue
Petite-vue adapter for Flight Framework. Lightweight alternative to Vue optimized for progressive enhancement.
Table of Contents
Installation
npm install @flightdev/ui @flightdev/ui-petite-vuePeer dependencies:
npm install petite-vueQuick Start
import { defineUI } from '@flightdev/ui';
import { petiteVue } from '@flightdev/ui-petite-vue';
const ui = defineUI(petiteVue());
const result = await ui.adapter.renderToString({
component: () => `
<div v-scope="{ count: 0 }">
<button @click="count++">{{ count }}</button>
</div>
`,
props: {},
});
console.log(result.html);Configuration
Configure the petite-vue adapter with options:
import { petiteVue } from '@flightdev/ui-petite-vue';
const adapter = petiteVue({
cdnUrl: 'https://unpkg.com/petite-vue',
});Available Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| cdnUrl | string | unpkg | Custom CDN URL |
API Reference
petiteVue(options?)
Create a petite-vue adapter instance.
function petiteVue(options?: PetiteVueAdapterOptions): PetiteVueAdapter;PetiteVueAdapter
| Method | Description |
|--------|-------------|
| renderToString(component, context?) | Render to HTML string |
| getHydrationScript(result) | Generate petite-vue include script |
| getClientEntry() | Get client entry code |
Capabilities
| Capability | Supported | |------------|-----------| | Streaming | No | | Partial Hydration | No | | Islands | No | | Resumable | No | | SSG | Yes | | CSR | Limited | | Server Components | No |
License
MIT
