Skip to content

Commit

Permalink
Adding sample files
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsislimadev committed Oct 7, 2023
1 parent 5bae1cd commit 4ee5ea0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
22 changes: 22 additions & 0 deletions sample/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE 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": "./libs/@brtmvdl/frontend/src/index.js"
}
}
</script>
</head>

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

</html>
12 changes: 12 additions & 0 deletions sample/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
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)

0 comments on commit 4ee5ea0

Please sign in to comment.