Skip to content

Instantly share code, notes, and snippets.

@vertcitron
Created September 25, 2019 21:35
Show Gist options
  • Save vertcitron/8bf9baba804ba39747ab2739fb68bd82 to your computer and use it in GitHub Desktop.
Save vertcitron/8bf9baba804ba39747ab2739fb68bd82 to your computer and use it in GitHub Desktop.
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