以下几乎可以运作......
$el = ->
$el:: = $ '#test'
new class extends $el
constructor: ->
@append '<h1>Worked!</h1>'
# this will overflow the stack
@find('[role=test2]').append '<h2>Also Worked!</h2>'
答案 0 :(得分:0)
答案是盯着我的脸......
new class
@:: = $ '#test'
constructor: ->
@append '<h1>Worked!</h1>'
@find('[role=test2]').append '<h2>Also Worked!</h2>'