Skip to content

Commit e67ef46

Browse files
authored
Merge pull request #13 from surveyjs/vue3-demos
Update Quiz and Multipage survey examples to Vue3
2 parents 72e77c6 + 5d689b4 commit e67ef46

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3482
-27
lines changed

get-started-creator/angular/angular.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
"budgets": [
4646
{
4747
"type": "initial",
48-
"maximumWarning": "2.5mb",
49-
"maximumError": "2.5mb"
48+
"maximumWarning": "3.0mb",
49+
"maximumError": "3.0mb"
5050
},
5151
{
5252
"type": "anyComponentStyle",
@@ -112,4 +112,4 @@
112112
}
113113
},
114114
"defaultProject": "get-started-creator-angular"
115-
}
115+
}

get-started-creator/react/package.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@
2424
"react-app/jest"
2525
]
2626
},
27+
"cssnano": {
28+
"preset": [
29+
"default",
30+
{
31+
"calc": false
32+
}
33+
]
34+
},
2735
"browserslist": {
2836
"production": [
2937
">0.2%",
@@ -36,4 +44,4 @@
3644
"last 1 safari version"
3745
]
3846
}
39-
}
47+
}

get-started-library/jquery/index.html

-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
<meta charset="utf-8">
66
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
77

8-
<!-- Default V2 theme -->
98
<link href="https://unpkg.com/survey-jquery/defaultV2.min.css" type="text/css" rel="stylesheet">
10-
11-
<!-- Modern theme -->
12-
<!-- <link href="https://unpkg.com/survey-jquery/modern.min.css" type="text/css" rel="stylesheet"> -->
139

1410
<script type="text/javascript" src="https://unpkg.com/survey-jquery/survey.jquery.min.js"></script>
1511
<script type="text/javascript" src="index.js"></script>

get-started-library/knockout/index.html

-4
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@
55
<meta charset="utf-8">
66
<script type="text/javascript" src="https://unpkg.com/knockout/build/output/knockout-latest.js"></script>
77

8-
<!-- Default V2 theme -->
98
<link href="https://unpkg.com/survey-jquery/defaultV2.min.css" type="text/css" rel="stylesheet">
109

11-
<!-- Modern theme -->
12-
<!-- <link href="https://unpkg.com/survey-jquery/modern.min.css" type="text/css" rel="stylesheet"> -->
13-
1410
<script type="text/javascript" src="https://unpkg.com/survey-core/survey.core.min.js"></script>
1511
<script type="text/javascript" src="https://unpkg.com/survey-knockout-ui/survey-knockout-ui.min.js"></script>
1612
<script type="text/javascript" src="index.js"></script>

get-started-library/react/src/App.js

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { useCallback } from 'react';
22

3-
// Default V2 theme
43
import 'survey-core/defaultV2.min.css';
5-
// Modern theme
6-
// import 'survey-core/modern.min.css';
74
import { Model } from 'survey-core';
85
import { Survey } from 'survey-react-ui';
96

get-started-library/vue/src/components/MyFirstSurvey.vue

+1-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
</template>
44

55
<script>
6-
// Default V2 theme
7-
import 'survey-core/defaultV2.min.css';
8-
// Modern theme
9-
// import 'survey-core/modern.min.css';
6+
import 'survey-core/defaultV2.css';
107
import { Model } from 'survey-core';
118
import { Survey } from 'survey-vue-ui';
129

get-started-library/vue/vue.config.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const { defineConfig } = require('@vue/cli-service')
2+
module.exports = {
3+
chainWebpack: config => {
4+
config.plugin('optimize-css').tap(([options]) => {
5+
options.cssnanoOptions.preset[1].calc = false;
6+
return [options];
7+
})
8+
}
9+
}

get-started-library/vue3/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false"
1111
},
1212
"dependencies": {
13-
"survey-vue3-ui": "^1.9.102",
13+
"survey-vue3-ui": "latest",
1414
"vue": "^3.3.4"
1515
},
1616
"devDependencies": {

legacy-angular/form-library/README.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ Open the `angular.json` file and reference a style sheet that implements the req
3838
// ...
3939
"styles": [
4040
"src/styles.css",
41-
// Default V2 theme
42-
"node_modules/survey-angular/defaultV2.min.css",
43-
// Modern theme
44-
// "node_modules/survey-angular/modern.min.css"
41+
"node_modules/survey-angular/defaultV2.min.css"
4542
],
4643
// ...
4744
}

multi-page-survey/vue/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Create a Multi-Page Survey (SurveyJS for Vue)
1+
# Create a Multi-Page Survey (SurveyJS for Vue 2)
22

33
This example is used in the following help topic: [Create a Multi-Page Survey](https://surveyjs.io/Documentation/Library?id=design-survey-create-a-multi-page-survey).
44

multi-page-survey/vue3/.gitignore

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
.DS_Store
12+
dist
13+
dist-ssr
14+
coverage
15+
*.local
16+
17+
/cypress/videos/
18+
/cypress/screenshots/
19+
20+
# Editor directories and files
21+
.vscode/*
22+
!.vscode/extensions.json
23+
.idea
24+
*.suo
25+
*.ntvs*
26+
*.njsproj
27+
*.sln
28+
*.sw?

multi-page-survey/vue3/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Create a Multi-Page Survey - Vue 3
2+
3+
This example is used in the following help topic: [Create a Multi-Page Survey](https://surveyjs.io/form-library/documentation/design-survey/create-a-multi-page-survey).
4+
5+
## Project setup
6+
7+
```
8+
npm install
9+
```
10+
11+
## Compile and hot-reload for development
12+
13+
```
14+
npm run dev
15+
```

multi-page-survey/vue3/env.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="vite/client" />

multi-page-survey/vue3/index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<link rel="icon" href="/favicon.ico">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>SurveyJS for Vue - Multi-Page Survey</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.ts"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)