Created
September 25, 2019 21:35
-
-
Save vertcitron/8bf9baba804ba39747ab2739fb68bd82 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import TextFieldButton from "./components/TextFieldButton" | |
const appElement = document.getElementById('app') | |
const textFieldBtn = new TextFieldButton() | |
textFieldBtn.placeholder = 'Enter text here...' | |
textFieldBtn.value = '' | |
textFieldBtn.onInput = (value: string) => { | |
console.log('Input event - value =', value) | |
} | |
textFieldBtn.onChange = (value: string) => { | |
console.log('Change event - value =', value) | |
} | |
function renderApp() { | |
if (appElement !== null) { | |
appElement.innerHTML = '' | |
textFieldBtn.render(appElement) | |
} | |
} | |
renderApp() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment