behavior does not init properly when parameters are "optional"
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript
- 领域
- frontend
调研方向
在 Hyperscript 0.9.12 中复现两个行为示例,然后跟踪 behavior init 如何处理省略的可选参数以及 clickElement 引用。完成的标准是:install alertMe() 默认将点击目标设为 me,同时显式的 clickElement: me 情况仍能正常工作。
由索引模型根据 Issue 内容生成。
描述
I'm using Hyperscript 0.9.12 and attempting to do something similar to what the Draggable example does. Default to "me" if a specific click target is not passed in.
The init block does not work.
<script type="text/hyperscript">
behavior alertMe(clickElement)
init
if no clickElement set the clickElement to me
end
on click from clickElement
call alert('behavior is working!')
end
end
</script>
<!-- Works: -->
<i _="install alertMe(clickElement: me)">click me</i>
<!-- Does not work: -->
<i _="install alertMe()">click me</i>
- 主要语言
- JavaScript
- 星标
- 3.8k
- 派生
- 171
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bigskysoftware/_hyperscript 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
bigskysoftware/_hyperscript#688 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
bigskysoftware/_hyperscript#678 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
bigskysoftware/_hyperscript#676 ·
-
难度 3/5 1-2 天 新手友好度 68/100
bigskysoftware/_hyperscript#695 ·
-
难度 3/5 1-2 天 新手友好度 62/100
bigskysoftware/_hyperscript#687 ·
查看 bigskysoftware/_hyperscript 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
XRPLF/xrpl-dev-portal#4000 ·
维护者通常 1 天内回复
-
accessibility good first issue
难度 1/5 1-3 小时 新手友好度 92/100
维护者通常 1 天内回复
-
[BUG] Bubble chart series name is not XML-escaped in the embedded workbook (xl/tables/table1.xml)未关闭
难度 1/5 1 小时以内 新手友好度 94/100
-
Content:Learn needs triage
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 88/100
anoopcodehack/DevBoard#609 ·
维护者通常 1 天内回复