survey-library icon indicating copy to clipboard operation
survey-library copied to clipboard

currentPage in vue3

Open tstrumfels opened this issue 1 year ago • 2 comments

Migrating an app from vue/vuetify 2 to vue/vuetify 3. New library renders fine, however I have external navigation. Cant figure out why I cant set currentPage or currentPageNo, as the page doesnt change.

Is there anything that would prevent that? What's odd is that the previous and next buttons work just fine

This method worked fine in vue 2, but not with a vue 3 setup.

const goToPage = (idx) => {
    const newPage = surveyObject.value.pages[idx];

    surveyObject.value.currentPage = newPage;

};

the currentPage stays set to original page, never changes.

tstrumfels avatar Jan 13 '24 05:01 tstrumfels

The only thing I've been able to figure out, is when i have my surveyObject initialized as a ref, changing the page programatically doesnt work

<SurveyComponent id="surveyElement" v-if="surveyObject" :survey="surveyObject"></SurveyComponent>

but when initialized as a normal variable, it works. Not sure why, but at least I have a path forward

tstrumfels avatar Jan 13 '24 18:01 tstrumfels

Hello @tstrumfels, Thank you for the update. You can review the following demo and learn how to implement external navigation for a Form Library for Vue3: Implement External Form Navigation. Be sure to install the latest "survey-vue3-ui" NPM package version. Should you have any further questions, please let me know.

Thanks

JaneSjs avatar Jan 22 '24 10:01 JaneSjs