Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Tabs List not rendering correctly #306

Closed
wbovela opened this issue Jul 4, 2019 · 1 comment
Closed

Tabs List not rendering correctly #306

wbovela opened this issue Jul 4, 2019 · 1 comment

Comments

@wbovela
Copy link

wbovela commented Jul 4, 2019

I am generating tab-content using a v-for, as per the example in issue #42. The tabs themselves are being generated correctly, but the tabs list at the top simply shows a list of tab titles. I also get the following warning in the console:

Prop startIndex set to 0 is greater than the number of tabs - 0.

The tabs work perfectly, I can navigate through them using the Next and Previous buttons.
Code included below. Not included is the generation of the pages array, but it's an array of objects.

What am I missing here?

                <form-wizard
                        ref="wizard"
                        shape="tab"
                        title=""
                        subtitle=""
                        color="#2196f3"
                        :start-index="startIndex"
                        @on-change="onSurveyTabSwitch"
                        @on-complete="onSurveyComplete"
                        >

                    <tab-content
                            v-for="(page, p_index) in pages"
                            :key="p_index"
                            :p_index="p_index"
                            :page="page"
                            :title="page.title"
                            icon="ti-info-alt">
                        <div class="columns is-full is-multiline">
                            <div class="column is-full">
                                <div style="margin-bottom:20px; font-weight:600;" class="sv_main sv_container sv_page_title">
                                    Page {{ page.title }}
                                </div>
                                <div v-for="(question, q_index) in page.questions" :key="`question-${q_index}`">
                                    <survey-question :question="question"  >
                                        <template v-slot:default="slotProps">
                                            <div style="visibility: hidden">
                                                {{ allAnswers.push(slotProps.answers) }}
                                            </div>
                                        </template>
                                    </survey-question>
                                </div>
                            </div>
                        </div>
                    </tab-content>
                    <template slot="footer" slot-scope="props">
                        <div class="wizard-footer-left">
                            <wizard-button v-if="props.activeTabIndex > 0" class="wizard-btn" :style="props.fillButtonStyle" @click.native="props.prevTab()">Previous</wizard-button>
                        </div>
                        <div class="wizard-footer-right" style="margin-right: 10px;">
                            <wizard-button v-if="!props.isLastStep" class="wizard-btn wizard-footer-right cancel-button" :style="props.fillButtonStyle" @click.native="props.nextTab()">Next</wizard-button>
                        </div>
                    </template>
                </form-wizard>
@wbovela
Copy link
Author

wbovela commented Jul 4, 2019

I didn't have the vue-form-wizard.min.css imported. Problem solved.

@wbovela wbovela closed this as completed Jul 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant