通常可以用
@constructor.name
取得但 IE並不支援JS裡的 function.name
所以可以改以
@constructor.toString().match(/^function\s(.+)\(/)[1]
@constructor.name
取得@constructor.toString().match(/^function\s(.+)\(/)[1]
switch layout
when 'case1'
_path= '_v/View1'
when 'case2'
_path= '_v/View2'
else
_path= '_v/View3'
require [_path],(View)=>
view= new View
el:'#container'
@dispatchEvent 'ready'