-
-
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.
* svg renderer added * json renderer moved to render/json.js * xml renerer uses HTML one temporary * README.md updated to reflect ^^
- Loading branch information
1 parent
ab49459
commit 2cd0838
Showing
9 changed files
with
270 additions
and
46 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,42 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>render table from json - FetchElement</title> | ||
<script type="module" src="https://unpkg.com/html-demo-element@1.0.7/html-demo-element.js"></script> | ||
<style> | ||
@import "demo.css"; | ||
</style> | ||
</head> | ||
<body> | ||
<h1> fetch-element render from JSON demo </h1> | ||
<a href="https://github.com/sashafirsov/slotted-element"><img src="https://cdnjs.cloudflare.com/ajax/libs/octicons/8.5.0/svg/mark-github.svg">git</a> | | ||
<a href="index.html"> slotted-element demo </a> | ||
<main> | ||
<html-demo-element legend="Custom renderer"> | ||
<json-render-element src="doc.json"></json-render-element> | ||
<script type="module"> | ||
import FetchElement from '../fetch-element.js'; | ||
window.customElements.define('json-render-element', | ||
class JsonElement extends FetchElement | ||
{ | ||
render(json) | ||
{ | ||
return `<h1>${ json.name }</h1> | ||
<img src="${ json.portrait }" alt="" /> | ||
`; | ||
} | ||
}); | ||
</script> | ||
</html-demo-element> | ||
|
||
<html-demo-element legend="Default as table"> | ||
<fetch-element src="doc.json"></fetch-element> | ||
</html-demo-element> | ||
|
||
<html-demo-element legend="Array as table"> | ||
<fetch-element src="dwarfs.json"></fetch-element> | ||
</html-demo-element> | ||
</main> | ||
</body> | ||
</html> |
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.