This repository has been archived by the owner on Dec 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d276c08
commit 9aee00d
Showing
6 changed files
with
135 additions
and
23 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import CreateComponent from "../../CreateComponent.js"; | ||
|
||
/** | ||
* ## AnchorView `<a>` | ||
* *from MDN Docs* | ||
* ### The Anchor element | ||
* The ``<a>`` HTML element (or anchor element), with its href attribute, | ||
* creates a hyperlink to web pages, files, email addresses, locations in the same page, | ||
* or anything else a URL can address. | ||
* Content within each ``<a>`` should indicate the link's destination. | ||
* If the href attribute is present, pressing the enter key while focused on the ``<a>`` element will activate it. | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | ||
*/ | ||
export default ({ children, style, styleSheet, to, id, className, events, hooks, flags }) => | ||
new CreateComponent({ | ||
tag: "a", | ||
children: children, | ||
inlineStyle: style, | ||
props: { | ||
id, | ||
href: to, | ||
}, | ||
className: className, | ||
events: { | ||
...events, | ||
onClick: (e) => { | ||
e.preventDefault(); | ||
if (router.goTo) { | ||
router.goTo(to); | ||
} | ||
}, | ||
}, | ||
hooks, | ||
style: styleSheet, | ||
flags, | ||
}); |
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