Vue
A Vite + Vue 3.5 single-page app using the typed @nlqdb/vue wrapper. This is the solo-builder’s alternative to the Nuxt example: same framework family, smaller footprint, no SSR — pick this when you want a static deploy on Pages.
Run it
Section titled “Run it”npm create vite@latest nlqdb-meals -- --template vue-tscd nlqdb-mealsnpm install @nlqdb/vue @nlqdb/elementsNot on npm yet —
@nlqdb/vueand@nlqdb/elementsare built onmainbut unpublished (docs/progress.md §0), so the install above 404s today. Until they publish, run this example inside the monorepo (bun installlinks the workspace packages) or use the CDN<nlq-data>element per the HTML example.
Replace src/main.ts and src/App.vue with the files in this folder, then:
echo "VITE_NLQDB_KEY=pk_live_yourkey" > .envnpm run devconfigureNlqdb(app)inmain.tsdoes two things: registers<NlqData>and<NlqAction>globally, and teaches Vue’s template compiler that the underlying<nlq-data>custom element is not a Vue component (silencing the unknown-tag warning).:api-keyuses Vue’s dynamic-attribute binding; the script tag forelements.nlqdb.com/v1.jsis injected by the wrapper itself the first time<NlqData>mounts — nouseHeador<svelte:head>needed.@loadis the Vue-idiomatic event handler; the payload type (NlqDataLoadDetail) re-exports from@nlqdb/elementsso it stays in sync with the underlying element.- For Nuxt (with SSR +
useRuntimeConfig), seeexamples/nuxt/.
Live code
Section titled “Live code”Source on GitHub: examples/vue/.