$mol
搜尋
⌘ K
文件
遊樂場
比較
生態系統
關於
ZH_HK
響應式微模組
$mol —— 響應式
微模組
框架
響應式能力根植於框架的底層,而非事後加裝。
依賴陣列、手動訂閱、手動快取失效、副作用清理——這些在這裡都不存在。不是變得更簡單,而是根本不需要。
開始使用
試用遊樂場
為什麼選 $mol
view.tree
$my_hello
$mol_view
guest
\stranger
sub
/
<=
Name
$mol_string
value
?
<=>
name
?
\mol
hint
@ \Type a name
<=
Greeting
$mol_paragraph
title
<=
greeting
\
view.ts
class
$my_hello
extends
$
.
$my_hello
{
greeting
(
)
{
return
`Hello, ${ this.name() || this.guest() }!`
}
}
view.css.ts
namespace
$
{
$mol_style_define
(
$my_hello
,
{
gap:
$mol_gap
.
block
,
flex:
{
direction
:
'column'
}
,
Greeting:
{
font:
{
size
:
'2rem'
,
weight:
600
}
,
}
,
}
)
}
→
即時
Hello, mol!
三個檔案:結構、邏輯與樣式。
試試這個例子
極簡
可漸進採用的生態系統,從單一元件到全端 local-first 應用都能勝任。
最佳
以元件樹的方式建構介面。響應式是自動的,副作用是顯式的。
惰性
完整的渲染虛擬化——視口之外的元件根本不存在。
結構
預設就是微模組架構
專案就是目錄,目錄就是儲存庫,框架放在你的程式旁邊而不是裡面。第一個元件和三十個專案的公司,版面是同一套。
mam/
工作區
├──
.meta.tree
登記表
├──
mol/
框架
└──
my/
你的套件
├──
my.meta.tree
你的登記表
└──
hello/
你的專案
├──
index.html
入口
└──
hello.view.tree
標記
五步開出自己的專案
1
複製一次 MAM。所有專案都住在這個工作區裡。
git clone https://github.com/hyoo-ru/mam.git
2
為自己建一個短名目錄,並當成儲存庫推上去。
mam/my/
3
在它旁邊放上你的專案登記表。
my/my.meta.tree
4
在裡面建專案,並給它自己的儲存庫。
my/hello/
5
登記它,讓新的檢出按名字把它取回來。
pack hello git \https://github.com/you/hello.git
為甚麼你的專案自成一個倉庫
專案是怎樣組織的
比較
同一個情境,在 React、Vue 和 $mol 中並排執行,就在你自己的瀏覽器裡即時進行。
打開比較
由 $mol vs React 開始
文件
快速開始
指南
教學
範例
API
關於
常見問題
團隊
發佈
資源
遊樂場
課程
UI 元件
Telegram
DEV Community
官方程式庫
$mol_wire
$mol_fetch
$mol_compare_deep
$mol_state_arg
$hyoo_crowd
Giper Baza
依 MIT 授權條款發佈。
Copyright © 2026 smalljs
Type to search the documentation.