survey-library
survey-library copied to clipboard
currentPage in vue3
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.
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
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