-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathSurveyCreator.vue
48 lines (42 loc) · 1.16 KB
/
SurveyCreator.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
<template>
<div id="surveyCreatorContainer"></div>
</template>
<script>
import { SurveyCreator } from "survey-creator-knockout";
import * as Survey from "survey-core";
import * as widgets from "surveyjs-widgets";
import { init as customWidget } from "../components/customwidget";
import "survey-core/defaultV2.css";
import "survey-creator-core/survey-creator-core.css";
// widgets.icheck(Survey);
widgets.select2(Survey);
widgets.inputmask(Survey);
widgets.jquerybarrating(Survey);
widgets.jqueryuidatepicker(Survey);
widgets.nouislider(Survey);
widgets.select2tagbox(Survey);
widgets.sortablejs(Survey);
widgets.ckeditor(Survey);
widgets.autocomplete(Survey);
widgets.bootstrapslider(Survey);
customWidget(Survey);
export default {
name: "survey-creator",
props: ['json'],
mounted() {
const options = { showLogicTab: true };
this.creator = new SurveyCreator(options);
this.creator.JSON = this.json;
this.creator.saveSurveyFunc = function() {
console.log(JSON.stringify(this.text));
};
this.creator.render("surveyCreatorContainer");
}
};
</script>
<style>
#surveyCreatorContainer {
height: calc(100vh - 125px);
width: 100vw;
}
</style>