Skip to content

Commit ffc5ad6

Browse files
committed
Update README and code
1 parent 29b0802 commit ffc5ad6

File tree

4 files changed

+38
-119
lines changed

4 files changed

+38
-119
lines changed

README.md

Lines changed: 25 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,38 @@
1-
# Nuxt 3 Minimal Starter
1+
# SurveyJS Form Builder + Nuxt Demo Example
22

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.
44

5-
## Setup
6-
7-
Make sure to install the dependencies:
5+
## Run the Application
86

97
```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
2911
npm run dev
30-
31-
# pnpm
32-
pnpm run dev
33-
34-
# yarn
35-
yarn dev
36-
37-
# bun
38-
bun run dev
3912
```
4013

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.
5115

52-
# yarn
53-
yarn build
16+
## How to add SurveyJS Form Builder to your Nuxt application
5417

55-
# bun
56-
bun run build
57-
```
58-
59-
Locally preview production build:
6018

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+
```
6424

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).
6732
68-
# yarn
69-
yarn preview
70-
71-
# bun
72-
bun run preview
73-
```
33+
## SurveyJS Resources
7434
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)

app.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
<template>
2-
<div>
3-
<!-- <MyFirstSurvey /> -->
2+
<div id="surveyCreator">
43
<SurveyCreator />
54
</div>
65
</template>
6+
7+
<style>
8+
#surveyCreator {
9+
height: 100vh;
10+
width: 100vw;
11+
}
12+
13+
body {
14+
margin: 0;
15+
}
16+
</style>

components/MyFirstSurvey.vue

Lines changed: 0 additions & 55 deletions
This file was deleted.

nuxt.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// https://nuxt.com/docs/api/configuration/nuxt-config
22
export default defineNuxtConfig({
3+
ssr: false,
34
compatibilityDate: '2024-04-03',
45
devtools: { enabled: true },
56
css: [

0 commit comments

Comments
 (0)