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

Tab subtitles #100

Closed
RedShift1 opened this issue Nov 22, 2017 · 1 comment
Closed

Tab subtitles #100

RedShift1 opened this issue Nov 22, 2017 · 1 comment

Comments

@RedShift1
Copy link

Support for tab subtitles would be nice, like demonstrated here:

form-wizard-tab-subtitles

Could probably be easily accomplished if HTML is allowed in the title. The subtitle can then be wrapped in a div (or whatever) and styled via CSS.

@cristijora
Copy link
Collaborator

cristijora commented Nov 22, 2017

You can pretty much achieve this look by using the step slot

<wizard-step 
                slot-scope="props"
                slot="step"
                :tab="props.tab"
                :transition="props.transition"
                :index="props.index">
                <div slot="title">
                  <div style="color: #3498db">
                    {{props.tab.title}}
                  </div>
                  Subtitle
                </div>
            </wizard-step>

Example https://jsfiddle.net/bt5dhqtf/1564/

However the approach is pretty limited since you would basically have to do some checks.
If you iterate through the tabs to display them, then this could be quite easy with a method
https://jsfiddle.net/bzfb4p8u/19/

<span>
    {{getSubTitle(props.index)}}
</span>
getSubTitle(index){
    return this.tabs[index].subtitle
}

If you need something more flexible, feel free to open a PR and add a prop on this component https://github.com/cristijora/vue-form-wizard/blob/master/src/components/TabContent.vue
which could be an object (e.g additionalInfo) where you could pass the subTitle or other information which you might need. Then, the customization of the step could become easier

<wizard-step 
                slot-scope="props"
                slot="step"
                :tab="props.tab"
                :transition="props.transition"
                :index="props.index">
                <div slot="title">
                  <div style="color: #3498db">
                    {{props.tab.title}}
                  </div>
                  {{props.tab.additionalInfo.subTitle}}
                </div>
 </wizard-step>

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

2 participants