Skip to content

[WIP] Implement on-click event system for components#126

Closed
Copilot wants to merge 1 commit intomainfrom
copilot/add-on-click-event-system
Closed

[WIP] Implement on-click event system for components#126
Copilot wants to merge 1 commit intomainfrom
copilot/add-on-click-event-system

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 1, 2026

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.

Original prompt

你是一个有20年经验的软件开发者和emacs专家,请实现类似 vue3 的事件系统,格式为在组件的 plist 中直接写以 "on-" 开头的keyword。事件的值中支持使用在 setup 中定义的变量或方法。

请先实现 :on-click 点击事件,要求进行系统化的通用设计,方便后续拓展支持更多的事件类型。要求支持下面类似 vue3 的多种格式的语法,也要通用的设计,不要局限于我下面的例子:

<button :on-click "doSomething">按钮

<button :on-click "doSomething(foo)">按钮

<button :on-click "count++">+1

更多的内联表达式的语法的例子:

"count=10"

"a++ ; b++"
"a-- ; b--"

"flag ? doA() : doB()"

"foo('bar', $event)"

"show && hidePanel()"

"count = count === 0 ? 1 : 0"

......

完成后请写一份设计和使用文档,放在 docs 目录中。


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

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.

2 participants