-
Notifications
You must be signed in to change notification settings - Fork 776
/
App.vue
51 lines (45 loc) · 926 Bytes
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<script lang="ts">
import { defineComponent } from "vue";
import { SurveyModel, StylesManager } from "survey-core";
import Survey from "./Survey.vue";
const json = {
"logoPosition": "right",
"pages": [
{
"name": "page1",
"elements": [
{
"type": "text",
"name": "question1"
},
{
"type": "text",
"name": "question2",
"visibleIf": "{question1} notempty"
}
]
}
]
};
StylesManager.applyTheme("defaultV2");
//window.survey = new SurveyModel(json);
export default defineComponent({
name: "App",
components: {
Survey,
},
data() {
const survey = new SurveyModel(json);
(<any>window)["survey"] = survey;
survey.title = "It works!";
survey.description = "This is the first survey in Vue3";
survey.surveyId = "Survey1";
return {
survey: survey as any,
};
},
});
</script>
<template>
<survey :survey="survey" />
</template>