リファレンス
タグの自動登録
import { … } from "@johnmorrisdotca/korokoro/element/define";
最小化と gzip 圧縮をしたサイズは 97.2 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The custom element, registered by being imported:
<script type="module" src="…/dist/element-define.js"></script><korokoro-roller notation="2d20kh1+5"></korokoro-roller> <korokoro-die sides="20"></korokoro-die>
This is the one module of the package that does something when it is
imported, and package.json says so, so that a bundler keeps it.
./element exports the same class and defineRoller() with no effect of
its own, for a page that wants to choose when, or under what tag.
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
defineDie | 関数 | Register <korokoro-die>, as that tag unless another is asked for. |
defineRoller | 関数 | Register the element, as <korokoro-roller> unless another tag is asked for. |
DIE_TAG | 定数 | The die's tag, unless another is asked for. |
KorokoroDie | クラス | ONE DIE ON ITS OWN, as a custom element: |
KorokoroRoller | クラス | The <korokoro-roller> element. |
ROLLER_TAG | 定数 | The element's tag, unless another is asked for. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。