快速开始

Dujie 是一个面向 UI 场景的 DSL。

第一个程序

创建一个 main.dj

func main() -> widget {
    text("Hello, World!")
}

变量与插值

func main() -> widget {
    let name = "World";
    text(`Hello, ${name}!`)
}

带动态入口数据

func main(props: map<string, any>) -> widget {
    let title = props["title"];

    if title is string(s) {
        text(s)
    } else {
        panic("title must be string")
    }
}

当前文档阅读顺序