Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MdBottomBarItem] Conditional Rendering of MdBottomBarItem #1412

Closed
mrwhy-orig opened this issue Jan 17, 2018 · 2 comments · Fixed by #1531
Closed

[MdBottomBarItem] Conditional Rendering of MdBottomBarItem #1412

mrwhy-orig opened this issue Jan 17, 2018 · 2 comments · Fixed by #1531
Labels

Comments

@mrwhy-orig
Copy link
Contributor

Use v-if with computed property on MdBottomBarItem

Recent Chrome/Firefox

What is expected?

The item shoukd be displayed or not and the correct route should be applied.

What is actually happening?

The item is displayed on the actual condition but, there is thrown an error as well and the routing isn't applied.
The error message tells that the "to" property has to be passed. The property is passed as simple String,

@mrwhy-orig mrwhy-orig changed the title Conditional Rendering of MdBottomBarItem [MdBottomBarItem] Conditional Rendering of MdBottomBarItem Jan 17, 2018
@Samuell1
Copy link
Member

Samuell1 commented Jan 17, 2018

Version of Vue Material and can you please provide your code?

@mrwhy-orig
Copy link
Contributor Author

mrwhy-orig commented Feb 9, 2018

Sorry, i forgot to provide the requested infos:

VueMaterial Beta 7 and Beta 8

<md-bottom-bar md-type="shift" class="md-layout md-alignment-center-center md-primary" md-sync-route>
<md-bottom-bar-item to="/" md-icon="home" md-label="Home" class="md-layout-item">
      </md-bottom-bar-item>
<md-bottom-bar-item v-if="funcPresent" to="/func" md-icon="lightbulb_outline" md-label="Func" class="md-layout-item"> </md-bottom-bar-item>
</md-bottom-bar>
export default {
    name: 'BottomNav',
    computed: {
        funcPresent(){
            return this.$store.getters.isFuncPresent;
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants