Skip to content

Commit

Permalink
Fix vue3 after render page is called too often
Browse files Browse the repository at this point in the history
  • Loading branch information
dk981234 committed Jan 12, 2024
1 parent 7f88df4 commit b39eeca
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions packages/survey-vue3-ui/src/Page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,23 @@ const props = defineProps<{
const root = ref<HTMLElement>(null as any);
useBase(() => props.page);
const onAfterRender = () => {
if (props.survey && root.value) {
props.survey.afterRenderPage(root.value);
}
};
useBase(
() => props.page,
() => {
onAfterRender();
}
);
const showDescription = computed(() => {
return props.page._showDescription;
});
onMounted(() => {
if (props.survey) {
props.survey.afterRenderPage(root.value);
}
});
onUpdated(() => {
props.survey.afterRenderPage(root.value);
onAfterRender();
});
</script>

0 comments on commit b39eeca

Please sign in to comment.