Skip to content

Commit

Permalink
feat: add support of data-router-ignore attribute
Browse files Browse the repository at this point in the history
Add data attribute because it can be dynamically controlled through a binding like `<a data-router-ignore.bind="condition || null"></a>`. This only works on data attribute, not normal attribute. Note `|| null` is required as dataAttributeAccessor only removes the attribute when value is null or undefined.
  • Loading branch information
3cp committed Jan 8, 2019
1 parent ea69690 commit 0d8f7a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/link-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class DefaultLinkHandler extends LinkHandler {
return info;
}

if (target.hasAttribute('download') || target.hasAttribute('router-ignore')) {
if (target.hasAttribute('download') || target.hasAttribute('router-ignore') || target.hasAttribute('data-router-ignore')) {
return info;
}

Expand Down

0 comments on commit 0d8f7a0

Please sign in to comment.