问题描述
我目前正在Angular + FullCalendar应用程序中渲染一些资源和事件。
在calendarOptions中,我有下一个resourceLabelDidMount()
方法:
resourceLabelDidMount: (info) => {
if (!info.el.classList.contains('section_item')) {
// Activity Info
let activityInfoElement = info.el.querySelector('.activity-info');
activityInfoElement.addEventListener('click',() => {
this.showActivityDescription(info);
});
// Event Creation / Management
let clickedElement = info.el.querySelector('.planificator');
clickedElement.addEventListener('click',() => {
this.showDialog(info);
})
}
},
问题是,当我在showDialog()
方法内运行下一个代码时(在此方法中,我需要创建一个与此资源相关联的事件,也许任何资源属性都必须更改-例如,优先级),我无法执行“点击”事件,则该点击只能执行一次。
let resource = this.calendarRef.getApi().getResourceById(res.activity.id)
resource.setExtendedProp('priority',1);
执行上一代码后,资源已更新,但是我无法再次运行与resourceLabelDidMount()
方法和在该方法内执行的addEventListener
相关的click事件。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)