Skip to content

Commit

Permalink
add missing src/link.mjs from template
Browse files Browse the repository at this point in the history
  • Loading branch information
arlac77 committed Jun 20, 2024
1 parent f620b0f commit d2bfc93
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/link.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { findClosestAttribute } from "./util.mjs";

export function link(node, router) {
node.addEventListener("click", event => {
event.preventDefault();
router.push(findClosestAttribute(event.target, "href"));
});
}

0 comments on commit d2bfc93

Please sign in to comment.