Keet.js v4.2.1

Keet.js v4.2.1

  • Docs
  • API
  • Help

›General Guideline

General Guideline

  • Introduction
  • Hello World
  • Ternary State
  • Functor State
  • Counter (eventListener)
  • Dynamic Nodes
  • List
  • List (advance)
  • Component

Counter

Handling State with eventListener

A simple counter application. This give you basic understanding how to work with DOM eventListener. To attach event we add a Node attribute with k-<event> where <event> could be one of any types of Events and the value is a string representing one our method in the component class.

import Keet, { html } from 'keet'

class App extends Keet {
  el = 'app'
  count = 0
  add() {
    this.count++
  }
  render() {
    return html`
      <button id="counter" k-click="add()">
        {{count}}
      </button>
    `
  }
}

const app = new App()

Codepen Sample

See the Pen Keetjs - Counter by Shahrul Nizam b. Selamat (@syarul) on CodePen.

← PreviousNext →
  • Handling State with eventListener
  • Codepen Sample
Keet.js v4.2.1
Extra
TodoMVCPerformance Benchmark
Community
Gitter Chat
on Github
Star  Fork  Issue

Generated with Docusaurus

Docusaurus
Copyright © 2018 Shahrul Nizam Selamat