项目
在 GitHub 查看
defx/synergy
关于
Synergy is a tiny runtime library for crafting Web Components
网站与应用开发可以做什么
- Simple templates for declarative data & event binding
- Reactive data bindings update your view efficiently and automatically
- Full component workflow using standard Custom Elements
- Small footprint (<5k)
实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文synergy
Synergy is a JavaScript library for building Web Components
Features
- Simple templates for declarative data & event binding
- Reactive data bindings update your view efficiently and automatically
- Full component workflow using standard Custom Elements
- Small footprint (<5k)
- No special compiler, plugins, required
- Minimal learning curve (almost entirely standard HTML, JS, and CSS!)
- Interoperable with other libraries and frameworks
Learn how to use Synergy in your own project.
Browser Support
Works in any modern browser that supports JavaScript Proxy.
Installation
Synergy is available from npm:
$ npm i synergy
You can also import Synergy directly in the browser via CDN:
<script type="module">
import { define } from "https://unpkg.com/synergy"
</script>
Documentation
You can find the Synergy documentation on the website.
Example
Step 1. Define your custom element
<script type="module">
import { define } from "https://unpkg.com/synergy"
define("hello-world", () => ({ name }), "<p>Hello {{ name }}!</p>")
</script>
Step 2. Use the Custom Element
<hello-world name="kimberley"></hello-world>
This example will render "Hello Kimberley!" into a container on the page.
You'll notice that everything here is valid HTML and JS, and you can copy and paste this example and run it directly in the browser with no need to compile or install anything special to make it work.
License
Synergy is MIT licensed.
探索相关项目
加载中…