Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.2k views
in Technique[技术] by (71.8m points)

vuejs中点击事件的设计

各位大侠,我想用户在点击一个vuejs页面上任何节点时,都触发一个方法,我该怎么写呢?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

emmm...事件采集吗?

标准做法是 document.onmousedown,不过对于阻止冒泡的就有问题了。

也可以覆写 HTMLElement.prototype.onclick,拦截所有元素的点击事件。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...