10 examples of 'routerlink vue' in JavaScript

Every line of 'routerlink vue' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
42function RouterLink(elementRef, _router, _location) {
43 this._router = _router;
44 this._location = _location;
45 this._domEl = elementRef.domElement;
46 this._params = collection_1.StringMapWrapper.create();
47}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

19set routerLink(data) {
20 if (Array.isArray(data)) {
21 this.commands = data;
22 }
23 else {
24 this.commands = [data];
25 }
26}
35routerLink(content) {
36 const component = content.path.split('/')[1];
37 const path = `/#/components/${component}/${component}-demo`;
38 window.location.href = window.location.origin + this.suffix(path);
39}
75function RouterLinkWithHref(router, route, locationStrategy) {
76 var _this = this;
77 this.router = router;
78 this.route = route;
79 this.locationStrategy = locationStrategy;
80 this.commands = [];
81 this.subscription = router.events.subscribe(function (s) {
82 if (s instanceof router_1.NavigationEnd) {
83 _this.updateTargetUrlAndHref();
84 }
85 });
86}
23export function href<RN extends Routes>(router: Router, route: RN, params: RouteParams[RN]) {
24 return router.link(`app.${route}`, params)
25}
81private isLinkActive(router: Router): (link: (RouterLink | RouterLinkWithHref)) => boolean {
82 return (link: RouterLink | RouterLinkWithHref) =>
83 router.isActive(link.urlTree, this.exact);
84}
33export function link(route, params) {
34 return () => navigate(route, params);
35}
21constructor(private router: Router, private hie: HierarchyService) {}
18get LinkComponent() {
19 return this.props.isExternal ? OutLink : Link
20}
55removeLink(link: HTMLElement) {
56 const i = this.links.indexOf(link);
57 if (i < 0) {
58 return;
59 }
60 this.links = this.links.splice(i, 1);
61}

Related snippets