Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

LemonadeJS is a 7KB reactive JavaScript micro-library offering two-way data binding. It is dependency-free, does not require transpiling, and works with webpack or directly in the browser.

License

NotificationsYou must be signed in to change notification settings

lemonadejs/lemonadejs

Repository files navigation

Create amazing web-based interfaces and framework-agnostic components with LemonadeJS

Micro Library

LemonadeJS is a super lightweight, reactive, vanilla JavaScript micro-library (7 KB). It helps integrate JavaScript (controllers) with HTML (view) through two-way data binding. It also integrates natively with jSuites to help you build amazing interfaces more quickly.

LemonadeJS enables the creation of reusable components without the need for a transpiler, Babel, or dozens of dependencies. It works seamlessly in any JavaScript development environment. With a fast learning curve, LemonadeJS keeps coding enjoyable and stays close to native JavaScript.

  • Build rich and user-friendly web interfaces and applications
  • Handle complex data inputs with ease
  • Enhance the software user experience
  • Create rich CRUD interfaces and beautiful UIs
  • Highly flexible and customizable
  • Lightweight and simple to use

Installation

NPM package

% npm install lemonadejs

Using from CDN

<scriptsrc="https://cdn.jsdelivr.net/npm/lemonadejs/dist/lemonade.min.js"></script>

Create a LemonadeJS sample app

% npx @lemonadejs/create myApp<br>% cd myApp<br>% npm run start<br>

Running tests

% npm run test

Examples

Webpack

Build modern applications with lemonadeJS and node.

See this example on StackBlitz

importlemonadefrom"lemonadejs";exportdefaultfunctionApp(){this.count=1;returnrender=>render`<div>        <p>You clicked${this.count} times</p>        <button>Click me</button>  </div>`;}

Browser

Simplicity to run in the browser without dependencies, servers, transpiler.

<html><body><divid="root"></div><scriptsrc="https://cdn.jsdelivr.net/npm/lemonadejs/dist/lemonade.min.js"></script><script>functionHello(){returnrender=>render`<h1>${this.title}</h1>`;}functionApp(){this.count=1;returnrender=>render`<div>        <Hello title="some title" />        <p>You clicked${this.count} times</p>        <button>Click me</button>  </div>`;}lemonade.render(App,document.getElementById('root'));</script></body></html>

Creating a table from an array of objects

importlemonadefrom"lemonadejs";exportdefaultfunctionComponent(){this.rows=[{title:'Google',description:'The alpha search engine...'},{title:'Bing',description:'The microsoft search engine...'},{title:'Duckduckgo',description:'Privacy in the first place...'},];// Custom components such as List should always be unique inside a real tag.returnrender=>render`<table cellpadding="6">        <thead><tr><th>Title</th><th>Description</th></th></thead>        <tbody :loop="${this.rows}">            <tr><td>{{self.title}}</td><td>{{self.description}}</td></tr>        </tbody>    </table>`;}

The event object

<html><body><divid='root'></div><scriptsrc="https://cdn.jsdelivr.net/npm/lemonadejs/dist/lemonade.min.js"></script><script>functionComponent(){consttest=(e)=>{console.log(e);e.preventDefault();}// The property call is added to the observable list when added to the DOMreturnrender=>render`<input type="button" value="Click test"/>`;}// Render the LemonadeJS element into the DOMlemonade.render(Component,document.getElementById('root'));</script></body></html>

Enable/disable HTML elements

<html><body><divid='root'></div><scriptsrc="https://cdn.jsdelivr.net/npm/lemonadejs/dist/lemonade.min.js"></script><script>functionApp(){this.disabled=false;consttoggle=()=>{this.disabled=!this.disabled;}returnrender=>render`<>      <button>Toggle</button>      <input type="text" disabled="${this.disabled}" />    </>`;}lemonade.render(App,document.getElementById('root'));</script></body></html>

License

This software is free to use, and it is distributed under the MIT license.

Learning LemonadeJS

Documentation

Libraries

Examples

Other tools

About

LemonadeJS is a 7KB reactive JavaScript micro-library offering two-way data binding. It is dependency-free, does not require transpiling, and works with webpack or directly in the browser.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors10


[8]ページ先頭

©2009-2025 Movatter.jp