|
1 |
| -# example |
| 1 | +# SurveyJS + Vue 3 Quickstart Template |
2 | 2 |
|
3 |
| -This template should help get you started developing with Vue 3 in Vite. |
| 3 | +SurveyJS is a set of JavaScript components that allow you and your users to build surveys / forms, store them in your database, and visualize survey results for data analysis. This quick start template uses Vue 3 and the following SurveyJS components: |
4 | 4 |
|
5 |
| -## Recommended IDE Setup |
| 5 | +- [SurveyJS Form Library](https://surveyjs.io/form-library/documentation/overview) |
| 6 | +- [Survey Creator / Form Builder](https://surveyjs.io/survey-creator/documentation/overview) |
| 7 | +- [SurveyJS PDF Generator](https://surveyjs.io/pdf-generator/documentation/overview) |
| 8 | +- [SurveyJS Dashboard](https://surveyjs.io/dashboard/documentation/overview) |
6 | 9 |
|
7 |
| -[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin). |
| 10 | +> NOTE: If you are looking for a similar quickstart template for a Vue 2 application, refer to the following project: [SurveyJS + Vue 2 Quickstart Template](https://github.com/surveyjs/surveyjs_vue_quickstart/). |
8 | 11 |
|
9 |
| -## Type Support for `.vue` Imports in TS |
| 12 | +## Run the application |
10 | 13 |
|
11 |
| -TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types. |
12 |
| - |
13 |
| -If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps: |
14 |
| - |
15 |
| -1. Disable the built-in TypeScript Extension |
16 |
| - 1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette |
17 |
| - 2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)` |
18 |
| -2. Reload the VSCode window by running `Developer: Reload Window` from the command palette. |
19 |
| - |
20 |
| -## Customize configuration |
21 |
| - |
22 |
| -See [Vite Configuration Reference](https://vitejs.dev/config/). |
23 |
| - |
24 |
| -## Project Setup |
25 |
| - |
26 |
| -```sh |
27 |
| -npm install |
28 |
| -``` |
29 |
| - |
30 |
| -### Compile and Hot-Reload for Development |
31 |
| - |
32 |
| -```sh |
| 14 | +```bash |
| 15 | +git clone https://github.com/surveyjs/surveyjs_vue3_quickstart.git |
| 16 | +cd surveyjs_vue3_quickstart |
| 17 | +npm i |
33 | 18 | npm run dev
|
34 | 19 | ```
|
35 | 20 |
|
36 |
| -### Type-Check, Compile and Minify for Production |
37 |
| - |
38 |
| -```sh |
39 |
| -npm run build |
40 |
| -``` |
41 |
| - |
42 |
| -### Lint with [ESLint](https://eslint.org/) |
43 |
| - |
44 |
| -```sh |
45 |
| -npm run lint |
46 |
| -``` |
| 21 | +Open http://localhost:5173/ in your web browser. |
| 22 | + |
| 23 | +## Template structure |
| 24 | + |
| 25 | +This template covers most basic use cases. You can find code examples for them in the following files: |
| 26 | + |
| 27 | +- Create a standalone survey |
| 28 | + - [data/survey_json.js](data/survey_json.js) |
| 29 | + - [src/components/Survey.vue](src/components/Survey.vue) |
| 30 | +- Add Survey Creator to a page |
| 31 | + - [src/components/Creator.vue](src/components/Creator.vue) |
| 32 | +- Export a survey to a PDF document |
| 33 | + - [src/components/PDFGenerator.vue](src/components/PDFGenerator.vue) |
| 34 | +- Visualize survey results |
| 35 | + - As charts |
| 36 | + - [data/dashboard_data.js](data/dashboard_data.js) |
| 37 | + - [src/components/Dashboard.vue](src/components/Dashboard.vue) |
| 38 | + - As a table (modern browsers) |
| 39 | + - [data/dashboard_data.js](data/dashboard_data.js) |
| 40 | + - [src/components/DashboardTabulator.vue](src/components/DashboardTabulator.vue) |
| 41 | + - As a table (old browsers) |
| 42 | + - [data/dashboard_data.js](data/dashboard_data.js) |
| 43 | + - [src/views/DashboardDatatables.vue](src/components/DashboardDatatables.vue) |
0 commit comments