Survey.StylesManager.applyTheme("default");
var json = {
"title": "Survey Title&Logo demo",
"description": "Please take look at the survey title and logo. Test the settings on the right panel ->",
"logo": "https://surveyjs.io/favicon.ico",
"logoWidth": 60,
"logoHeight": 60,
"questions": [
{
"name": "name",
"type": "text",
"title": "Please enter your name:",
"placeHolder": "Jon Snow",
"isRequired": true
},
{
"name": "birthdate",
"type": "text",
"inputType": "date",
"title": "Your birthdate:",
"isRequired": true
},
{
"name": "color",
"type": "text",
"inputType": "color",
"title": "Your favorite color:"
},
{
"name": "email",
"type": "text",
"inputType": "email",
"title": "Your e-mail:",
"placeHolder": "jon.snow@nightwatch.org",
"isRequired": true,
"validators": [ { "type": "email" } ]
}
]
};
window.survey = new Survey.Model(json);
survey.onComplete.add(function(result) {
document.querySelector('#surveyResult').textContent =
"Result JSON:\n" + JSON.stringify(result.data, null, 3);
});
var app = new Vue({
el: '#surveyElement',
data:
{
survey: survey
}
});
<!DOCTYPE html>
<html lang="en">
<head>
<title>Add your logo to the survey title., Vue Survey Library Example</title>
<meta name="viewport" content="width=device-width" />
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="/DevBuilds/survey-vue/survey.vue.min.js"></script>
<link href="/DevBuilds/survey-knockout/survey.min.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" href="./index.css">
</head>
<body>
<div id="surveyElement" style="display:inline-block;width:100%;">
<survey :survey='survey' />
</div>
<div id="surveyResult"></div>
<script type="text/javascript" src="./index.js"></script>
</body>
</html>