Skip to content

Commit

Permalink
Updating README.md file
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsislimadev committed Oct 7, 2023
1 parent 4ee5ea0 commit 760d395
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 35 deletions.
38 changes: 3 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,11 @@ Easy Front-end Node.js library
npm i @brtmvdl/frontend
```

## hot to use

```html
<!-- index.html -->

<head>
<script type="importmap">
{
"imports": {
"@brtmvdl/frontend": "./libs/@brtmvdl/frontend/src/index.js"
}
}
</script>
</head>

<body>
<div id="app"></div>
<script type="module" src="./index.js"></script>
</body>
```

```js
// index.js

import { HTML, nInput, nButton } from '@brtmvdl/frontend'
## how to use

const app = HTML.fromId('app')
[![index.html](./images/frontend-index-html.png)](./sample/index.html)

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)
```
[![index.js](./images/frontend-index-js.png)](./sample/index.js)

## License

Expand Down
Binary file added images/frontend-index-html.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/frontend-index-js.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 760d395

Please sign in to comment.