Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use customEvent replace kzEvent #1

Open
konglx90 opened this issue Feb 1, 2020 · 1 comment
Open

Use customEvent replace kzEvent #1

konglx90 opened this issue Feb 1, 2020 · 1 comment

Comments

@konglx90
Copy link
Contributor

konglx90 commented Feb 1, 2020

// 添加一个适当的事件监听器
document.body.addEventListener(
  "kz:form:submit-success", 
  function(e) { console.log(e.detail) }
)

// 创建并分发事件
var event = new CustomEvent(
  "kz:form:submit-success", 
  {"detail": { _id: '121313' }}
)
document.body.dispatchEvent(event)
@konglx90
Copy link
Contributor Author

konglx90 commented Feb 1, 2020

有些东西如果可以使用标准的方案解决 ,尽量使用标准

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

No branches or pull requests

1 participant