以下内容几乎有效...
$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>'
最佳答案
答案就在我面前……
new class
@:: = $ '#test'
constructor: ->
@append '<h1>Worked!</h1>'
@find('[role=test2]').append '<h2>Also Worked!</h2>'
关于jquery - 如何使用 jQuery 包装集扩展类?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29017782/