Split into category packages; module github.com/ZacharyZhang-NY/MujicaUI

This commit is contained in:
ZacharyZhang-NY committed 2026-10-05 16:18:48 -04:00
1 parent 5a7e921c7e
commit 22b53e9e9e
1822 files changed
+24568 -21314

No files matched your search

+4 -4
View File
@@ -7,11 +7,11 @@
## 最小示例
```go
roots := []mujica.SchemaNode{{Name: "app", Children: []mujica.SchemaNode{{Name: "users", Kind: mujica.SchemaTable, Children: []mujica.SchemaNode{{Name: "id", Kind: mujica.SchemaColumn, Detail: "bigint"}, {Name: "users_pk", Kind: mujica.SchemaIndex, Detail: "(id)"}}}}}}
var state mujica.SchemaTreeState
roots := []devtools.SchemaNode{{Name: "app", Children: []devtools.SchemaNode{{Name: "users", Kind: devtools.SchemaTable, Children: []devtools.SchemaNode{{Name: "id", Kind: devtools.SchemaColumn, Detail: "bigint"}, {Name: "users_pk", Kind: devtools.SchemaIndex, Detail: "(id)"}}}}}}
var state devtools.SchemaTreeState
view := func(c *ui.Context) {
mujica.Use(c, mujica.Settings{})
if mujica.SchemaTree(c, &state, roots, mujica.SchemaTreeOptions{}).Changed() {
core.Use(c, core.Settings{})
if devtools.SchemaTree(c, &state, roots, devtools.SchemaTreeOptions{}).Changed() {
path, _ := state.Selected()
fmt.Println("selected", path)
}