javascript - FullCalendar 中的 eventContent 添加的按钮上的函数调用
问题描述
日历
我正在 Angular 中集成完整的日历。我在完整的日历中添加了不同的事件。在每个事件中,我都在事件中添加了按钮。无论我在哪里点击事件,都会调用完整日历的事件点击。当用户单击事件内容内的按钮时,我想调用一个函数。有人可以帮助我我该怎么做。
下面是我在完整日历事件中的按钮代码。
解决方案
如果我真的明白你的要求,那么 ans 是
event.stopPropagation();
片段示例
function parent(event) {
console.log(alert("parent"))
}
function child(event) {
event.stopPropagation();
console.log(alert("child"))
}
.parent{
width: 200px;
height: 200px;
background-color: red;
margin :auto ;
}
.child {
width:100px;
height:100px;
margin:auto;
background-color: blue;
}
<div class = "parent" onclick = "parent(event)" >
<div class = "child" onclick = "child(event)">
child
</div>
</div>
推荐阅读
- javascript - 根据数组值angularjs分配ng-class值
- sharepoint - Jira:我想与 Service Now 和 Share Point 集成
- html - 无法将新数据集分配给 ng4 图表
- c++ - 通过 CMAKE 将配置文件作为静态库的一部分
- c# - 如何在winforms的实时图表中自定义图例?
- kubernetes - Ubuntu上的kubernetes:通过consul与其他主机交互的微服务问题
- java - 如何在 gradle 文件中的一个任务中执行多个 shell 脚本
- java - 将 hashmap 作为值添加到 hashmap
- google-docs - Google 文档或其他插件中的插件,用于在 App Maker 中提供功能
- php - 使用 create_shared_link_with_settings 的路径问题