Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

パラメータオブジェクトをメソッドチェーンで構築できるようにする #97

Merged
merged 6 commits into from
May 5, 2024

Conversation

omochi
Copy link
Owner

@omochi omochi commented May 3, 2024

こんな感じで書けるようになる

                div(
                    style: .init()
                        .display("flex")
                        .alignItems("center")
                        .gap("16px")
                ) {
                    button(
                        attributes: .init()
                            .class("button"),
                        listeners: .init()
                            .click(onAboutButton)
                    ) {
                        "About"
                    }

                    a(
                        attributes: .init()
                            .href("https://github.com/omochi/swift-string-counter-web")
                    ) {
                        button(
                            attributes: .init()
                                .class("button")
                        ) {
                            "GitHub"
                        }
                    }
                }

とりあえず試しに手書きしたが、たくさんあるので自動生成が必要

@omochi
Copy link
Owner Author

omochi commented May 5, 2024

タグのアトリビュート、スタイル、イベントを定義セットから自動生成するようにした

@omochi omochi merged commit 19644da into main May 5, 2024
@omochi omochi deleted the method-chain-style branch May 5, 2024 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant