npm-packages/docs/docs/quickstart/vue.mdx
import sampleData from "!!raw-loader!@site/../private-demos/quickstarts/vue/sampleData.jsonl"; import main from "!!raw-loader!@site/../private-demos/quickstarts/vue/src/main.ts"; import tasks from "!!raw-loader!@site/../private-demos/quickstarts/vue/convex/tasks.ts"; import App from "!!raw-loader!@site/../private-demos/quickstarts/vue/src/App.vue";
Learn how to query data from Convex in a Vue app.
This quickstart guide uses a community-maintained Vue client for Convex.
<StepByStep> <Step title="Create a Vue site"> Create a Vue site using the `npm create vue@latest my-vue-app` command.Convex will work with any set of options but to follow this quickstart most closely choose:
* Yes to "Add TypeScript?"
* No to everything else
```sh
npm create vue@latest my-vue-app
```
```sh
cd my-vue-app && npm install convex convex-vue
```
It will also create a `convex/` folder for you
to write your backend API functions in. The `dev` command
will then continue running to sync your functions
with your dev deployment in the cloud.
```sh
npx convex dev
```
<Snippet
source={sampleData}
title="sampleData.jsonl"
/>
```
npx convex import --table tasks sampleData.jsonl
```
Exporting a query function from this file
declares an API function named after the file
and the export name, `api.tasks.get`.
<Snippet
source={tasks}
title="convex/tasks.ts"
/>
<Snippet
source={main}
title="src/main.ts"
/>
<Snippet
source={App}
title="src/App.vue"
/>
```sh
npm run dev
```
See the complete Vue npm package documentation.