<template>
   <div>
        <survey v-if="survey"  :survey="survey"></survey>
   </div>
</template>

<script>
export default {
  name: 'preview',
  props: {
    surveyData: {
      default () {
        return {}
      }
    }
  },
  computed: {
  },
  mounted () {
    this.$nextTick(() => {
      const triggers = this.surveyData.triggers || []
      const pages = this.surveyData.pages || []
      const showQuestionNumbers = this.surveyData.showQuestionNumbers || 'on'
      this.survey = new this._survey.Model({ pages, triggers, showQuestionNumbers })
    })
  },
  components: {

  },
  data () {
    return {
      survey: null
    }
  },
  methods: {

  }
}
</script>

<style >
@import "./bootstrap-datepicker.css";
</style>
