-
-
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
d18acb4
commit d38dace
Showing
3 changed files
with
84 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,46 +21,8 @@ mv node_modules libs | |
|
||
## how to use | ||
|
||
```html | ||
<!-- index.html --> | ||
|
||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Front-end</title> | ||
<script type="importmap"> | ||
{ | ||
"imports": { | ||
"@brtmvdl/frontend": "https://cdn.jsdelivr.net/npm/@brtmvdl/[email protected]/src/index.js" | ||
} | ||
} | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="./index.js"></script> | ||
</body> | ||
</html> | ||
``` | ||
|
||
```js | ||
// index.js | ||
|
||
import { HTML, nInput, nButton } from '@brtmvdl/frontend' | ||
|
||
const app = HTML.fromId('app') | ||
|
||
const input = new nInput() | ||
input.setPlaceholder('input') | ||
app.append(input) | ||
|
||
const button = new nButton() | ||
button.setText('button') | ||
button.on('click', () => window.alert(`value: ${input.getValue()}`)) | ||
app.append(button) | ||
``` | ||
[Example 01](./exaples/example-01.md) | ||
[Example 02](./exaples/example-02.md) | ||
|
||
## license | ||
|
||
|
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,41 @@ | ||
|
||
```html | ||
<!-- index.html --> | ||
|
||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Front-end</title> | ||
<script type="importmap"> | ||
{ | ||
"imports": { | ||
"@brtmvdl/frontend": "https://cdn.jsdelivr.net/npm/@brtmvdl/[email protected]/src/index.js" | ||
} | ||
} | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="./index.js"></script> | ||
</body> | ||
</html> | ||
``` | ||
|
||
```js | ||
// index.js | ||
|
||
import { HTML, nInput, nButton } from '@brtmvdl/frontend' | ||
|
||
const app = HTML.fromId('app') | ||
|
||
const input = new nInput() | ||
input.setPlaceholder('input') | ||
app.append(input) | ||
|
||
const button = new nButton() | ||
button.setText('button') | ||
button.on('click', () => window.alert(`value: ${input.getValue()}`)) | ||
app.append(button) | ||
``` |
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,41 @@ | ||
|
||
```html | ||
<!-- index.html --> | ||
|
||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>brtmvdl</title> | ||
<script type="importmap"> | ||
{ | ||
"imports": { | ||
"@brtmvdl/frontend": "https://cdn.jsdelivr.net/npm/@brtmvdl/[email protected]/src/index.js" | ||
} | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module"> | ||
import { HTML } from '@brtmvdl/frontend' | ||
import { Page } from './index.js' | ||
HTML.fromElement(document.body).setStyle('margin', '0') | ||
HTML.fromId('app').append(new Page()) | ||
</script> | ||
</body> | ||
</html> | ||
``` | ||
|
||
```js | ||
// index.js | ||
|
||
import { HTML } from '@brtmvdl/frontend' | ||
|
||
export class Page extends HTML { | ||
onCreate() { | ||
super.onCreate() | ||
this.setText('page') | ||
} | ||
} | ||
``` |