如何使用mouseenter和mouseleave事件?

时间:2012-03-28 17:03:09

标签: ember.js

我正在使用http://cloud.github.com/downloads/emberjs/ember.js/ember-0.9.5.js,我不确定如何使用mouseenter和mouseleave事件。我的代码如下,click事件运行正常。如何让mouseenter和mouseleave事件起作用?

window.App = Ember.Application.create()

TestView = Ember.View.create
  template: Ember.Handlebars.compile 'This is the view'
  click: (evt) ->
    console.log 'clicked'
  mouseenter: (evt) ->
    console.log 'mouse enter'
  mouseleave: (evt) ->
    console.log 'mouse leave'

TestView.append()

1 个答案:

答案 0 :(得分:12)

Ember.js中的事件由Ember.EventDispatcher处理,如果你愿意的话,这些名称会被翻译成更多的Ember.js,见here

您必须将鼠标事件更改为mouseEntermouseLeave,请参阅http://jsfiddle.net/pangratz666/QtZ2T/

相关问题