|
1 | | -# Nuxt 3 Minimal Starter |
| 1 | +# SurveyJS Form Builder + Nuxt Demo Example |
2 | 2 |
|
3 | | -Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more. |
| 3 | +This demo shows how to add [SurveyJS Form Builder / Survey Creator](https://surveyjs.io/survey-creator/documentation/overview) to a Nuxt application. |
4 | 4 |
|
5 | | -## Setup |
6 | | - |
7 | | -Make sure to install the dependencies: |
| 5 | +## Run the Application |
8 | 6 |
|
9 | 7 | ```bash |
10 | | -# npm |
11 | | -npm install |
12 | | - |
13 | | -# pnpm |
14 | | -pnpm install |
15 | | - |
16 | | -# yarn |
17 | | -yarn install |
18 | | - |
19 | | -# bun |
20 | | -bun install |
21 | | -``` |
22 | | - |
23 | | -## Development Server |
24 | | - |
25 | | -Start the development server on `http://localhost:3000`: |
26 | | - |
27 | | -```bash |
28 | | -# npm |
| 8 | +git clone https://github.com/surveyjs/surveyjs-nuxtjs.git |
| 9 | +cd surveyjs-nuxtjs |
| 10 | +npm i |
29 | 11 | npm run dev |
30 | | - |
31 | | -# pnpm |
32 | | -pnpm run dev |
33 | | - |
34 | | -# yarn |
35 | | -yarn dev |
36 | | - |
37 | | -# bun |
38 | | -bun run dev |
39 | 12 | ``` |
40 | 13 |
|
41 | | -## Production |
42 | | - |
43 | | -Build the application for production: |
44 | | - |
45 | | -```bash |
46 | | -# npm |
47 | | -npm run build |
48 | | - |
49 | | -# pnpm |
50 | | -pnpm run build |
| 14 | +Open http://localhost:3000 in your web browser. |
51 | 15 |
|
52 | | -# yarn |
53 | | -yarn build |
| 16 | +## How to add SurveyJS Form Builder to your Nuxt application |
54 | 17 |
|
55 | | -# bun |
56 | | -bun run build |
57 | | -``` |
58 | | - |
59 | | -Locally preview production build: |
60 | 18 |
|
61 | | -```bash |
62 | | -# npm |
63 | | -npm run preview |
| 19 | +1. Install the `survey-creator-vue` npm package: |
| 20 | + |
| 21 | + ```bash |
| 22 | + npm install survey-creator-vue --save |
| 23 | + ``` |
64 | 24 |
|
65 | | -# pnpm |
66 | | -pnpm run preview |
| 25 | +2. Create a file in the [`plugins`](./plugins/) directory and install SurveyJS Vue plugins in this file using the `nuxtApp.vueApp.use()` method. |
| 26 | +3. Open the [`next.config.ts`](./nuxt.config.ts) file and do the following in it: |
| 27 | + 1. List the plugin file in the `plugins` array. |
| 28 | + 2. List SurveyJS style sheets in the `css` array. |
| 29 | + 3. Disable server-side rendering. |
| 30 | +4. Create a component and configure Survey Creator in it (see the [`components/SurveyCreator.vue`](./components/SurveyCreator.vue) file). |
| 31 | +5. Render the component on a page (see the [`app.vue`](./app.vue) file). |
67 | 32 |
|
68 | | -# yarn |
69 | | -yarn preview |
70 | | - |
71 | | -# bun |
72 | | -bun run preview |
73 | | -``` |
| 33 | +## SurveyJS Resources |
74 | 34 |
|
75 | | -Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information. |
| 35 | +- [Website](https://surveyjs.io/) |
| 36 | +- [Documentation](https://surveyjs.io/survey-creator/documentation/overview) |
| 37 | +- [Starter Demos](https://surveyjs.io/survey-creator/examples/free-nps-survey-template/reactjs) |
| 38 | +- [What's New](https://surveyjs.io/stay-updated/major-updates/2023) |
0 commit comments