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

fix(MdBottomBarItem): missing props to for router link #1531

Merged
merged 1 commit into from
Feb 20, 2018
Merged

fix(MdBottomBarItem): missing props to for router link #1531

merged 1 commit into from
Feb 20, 2018

Conversation

VdustR
Copy link
Member

@VdustR VdustR commented Feb 20, 2018

Fix missing props to for vue router link after $attrs changed.

$attrs is read only, so I think replace it with a new computed attrs is better.

Notice that the props to would be always sent via props, therefore there will be no html attribute to on <a> anymore.

fix #1412

My test case:

<template>
  <div>
    <md-checkbox v-model="funcPresent">test</md-checkbox>
    <md-bottom-bar md-type="shift" class="md-layout md-alignment-center-center md-primary" md-sync-route>
      <md-bottom-bar-item to="/components/bottom-bar/123" md-icon="home" md-label="Home" class="md-layout-item">
      </md-bottom-bar-item>
      <md-bottom-bar-item v-if="funcPresent" to="/components/bottom-bar/func" md-icon="lightbulb_outline" md-label="Func" class="md-layout-item"> </md-bottom-bar-item>
    </md-bottom-bar>
  </div>
</template>

<script>
  export default {
    name: 'BarRouter',

    data () {
      return {
        funcPresent: false
      }
    }
  }

</script>

<style lang="scss" scoped>
  .phone-viewport {
    width: 322px;
    height: 200px;
    display: inline-flex;
    align-items: flex-end;
    overflow: hidden;
    border: 1px solid rgba(#000, .26);
    background: rgba(#000, .06);
  }

</style>

@marcosmoura
Copy link
Member

This is the same thing for tabs too. Can you change the tabs as well? I will merge this one and, if possible, you can create another PR :D

@marcosmoura marcosmoura merged commit 6860d3a into vuematerial:dev Feb 20, 2018
@VdustR
Copy link
Member Author

VdustR commented Feb 20, 2018

I think there is no similar bug with MdTab.

props: this.getPropValues(),

@VdustR VdustR deleted the fix#1412 branch February 20, 2018 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MdBottomBarItem] Conditional Rendering of MdBottomBarItem
2 participants