Question T10417
Visible to All Users

Not render survey in vue component

created 3 years ago (modified 3 years ago)

I get survey from data jsonb, and get to component
My code:

Code
<template lang="pug"> survey(:survey="survey_render") </template> <script lang="coffee"> import { Survey } from 'survey-vue-ui' import { StylesManager, Model } from 'survey-core' import 'survey-core/survey.min.css'; StylesManager.applyTheme("survey") surveyJson = {"logoPosition":"right","pages":[{"name":"page1","elements":[{"type":"checkbox","name":"question1","title":"как дела","choices": [{"value":"item1","text":"хорошо"},{"value":"item2","text":"норм"}],"hasSelectAll":true,"selectAllText":"все"}, {"type":"text","name":"question2","title":"все ок?"}]}]} export default { components: { Survey } props: { survey_item: { type: Object } } data: -> { survey_render: new Model(@survey_item) } } </script>

and this message is render(attached pic)
But, i tried the same json hash from surveyJson variable and it renders

Show previous comments (4)

    Hello Odin,
    How do you set JSON from your database to the survey model? I believe the issue is here.

    Thank you,
    Andrew
    SurveyJS Team

      Raw JsonB in pg

        Could you provide the code that set your JSON from database into Survey model?
        You can emulate your code, by setting your JSON constant on setTimeout() function.

        Thank you,
        Andrew
        SurveyJS Team