Allow Custom Components to embed Standard Components

未關閉
#747 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
30/100
Issue 類型
功能
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
rust, sql
領域
frontend

研究方向

Start by reading SQLPage's custom-component implementation and how standard components are rendered; the issue does not name specific files or tests. The proposed composition mechanism is undecided, so first investigate the existing component model and discuss a design with maintainers before implementation. Done would mean custom components can embed caller-supplied standard components, with tests demonstrating the composition.

由索引模型根據 Issue 內容生成。

描述

enhancement

What are you building with SQLPage ?

A project wiki.

What is your problem ? A description of the problem, not the solution you are proposing.

I am using htmx to render modal dialogs for data entry.

At the moment I am using three custom components for this:

  • the htmx enriched button
  • the modal header
  • the modal footer

Having to render a header, then my content using standard components, then the footer feels a bit off. It would be really cool if a custom component could render other components inside themselves somehow - that the caller could somehow supply the body.

What are you currently doing ? Since your solution is not implemented in SQLPage currently, what are you doing instead ?

Separate header, footer as detailed above.

Describe the solution you'd like

Honestly I don't really know the cleanest way to express this. Being able to supply the body of a component using a subselect? I'm not sure. I guess I'm hopeful to have a set of smaller components that can be assembled by a custom component rather than having to specify everything on the custom component. I suspect this would be a total can of worms though.

Describe alternatives you've considered

Copy and pasting standard component template code into my own custom templates - it's not maintainable or pretty. The card component doesn't really work for this scenario either.

主要語言
Rust
星號
2.6k
分支
175
平均合併
14 小時 16 分鐘
30 天內合併 PR
43

環境準備

  • 提供 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

sqlpage/SQLPage 的其他 Issue

查看 sqlpage/SQLPage 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。