-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Router link components improvement #1651
Merged
Merged
Changes from 13 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
627009b
fix(MdTab): exact router
VdustR 4c67b31
fix(MdList): non-exact router active style
VdustR fb0c1f9
fix(MdBottomBar router): elegant router with active class
VdustR c45c279
fix(MdTabs): elegant router with active class
VdustR efb741e
fix(MdBottomBar): fix bugs
VdustR 6240ac1
docs(WithRouter): discriptions about working with vue router
VdustR ebfb31b
fix(MdTabs): better setIndicatorStyles performance with throttling
VdustR f7d3ae3
fix(MdTabs): fix bugs
VdustR 8d26d4c
docs(TabRouter): Better example
VdustR fe4388c
docs(TabRouter): remove unused codes
VdustR ddfdaa1
feat(MdSteppers): elegant router with active class
VdustR b6a5e4c
docs(WithRouter): add md-step
VdustR cdb4b9e
feat(MdStep): support all router-link props
VdustR 93cfab9
refactor(MdThrottling): reduce duplicated code for getting options
VdustR 7296e13
fix(MdThrottling): typo
VdustR 1445a7a
fix(routes): doc production mapRoutes method replace string
VdustR 9ff7945
Merge branch 'dev' into fix/router/exact
VdustR 7cbd33c
refactor(MdButton): lint complexity
VdustR 37abf9b
chore: resolve conflicts
VdustR 40ce55c
chore(MdTabs): resolve conflicts
VdustR File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<template> | ||
<page-container centered :title="$t('pages.withRouter.title')"> | ||
<div class="page-container-section"> | ||
<h2 class="md-headline">Vue Material Router Link Components</h2> | ||
<p>Vue router supported with <code><router-link to="/components/tabs">md-tab</router-link></code>, <code><router-link to="/components/list">md-list-item</router-link></code>, <code><router-link to="/components/bottom-bar">md-bottom-bar-item</router-link></code> and <code><router-link to="/components/steppers">md-step</router-link></code> so far.</p> | ||
<p>Vue Material router link components will be auto-generated with the prop <code>to</code>. All <a href="https://router.vuejs.org/en/api/router-link.html"><code>router-link</code> props</a> except <code>tag</code> accepted.</p> | ||
<h2 class="md-headline">Work with Router option <code>linkActiveClass</code></h2> | ||
<p>Since Vue Router doesn't expose <code>isSameRoute</code> and <code>isIncludedRoute</code> methods, Vue Material cannot detect which links are active. Vue Material inject <code>linkActiveClass</code> with an extra active class to interact with router. Therefore, if you want to using an custom class for active link as default, you need to setup like this:</p> | ||
<code-example title="Individual components"> | ||
const linkActiveClass = 'my-link-active-class' | ||
|
||
// pass custom class to Vue Material | ||
Vue.material.router.linkActiveClass = linkActiveClass | ||
|
||
// pass custom class to Vue Router | ||
router = new VueRouter({ | ||
routes, | ||
linkActiveClass | ||
}) | ||
|
||
const app = new Vue({ | ||
name: 'Root', | ||
router, | ||
}) | ||
|
||
</code-example> | ||
</div> | ||
</page-container> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'WithRouter' | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this
:sub?
needed? It's breaking the 'docs-build' task.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, they are for sub-subpages.