小编Sar*_*hak的帖子

有没有办法表示路由闭包动作,而不是在组件垫片中写入它们?

我正在使用ember-route-action-helper

我有一个组件垫片看起来像这样:

{{component-name model=model 
action1=(route-action "action1") 
action2=(route-action "action2") 
action3=(route-action "action3") 
action4=(route-action "action4") 
action5=(route-action "action5") 
action6=(route-action "action6") 
action7=(route-action "action7") 
action8=(route-action "action8")
action9=(route-action "action9") 
action10=(route-action "action10")
action11=(route-action "action11")
action12=(route-action "action12") 
action13=(route-action "action13") 
action14=(route-action "action14")
}}
Run Code Online (Sandbox Code Playgroud)

PS以上操作未使用实际操作名称

有很多动作需要冒泡到路线,我不在我的ember应用程序中使用控制器.

由于行动太多,这看起来有点笨拙.有没有办法用另一种格式表示相同的信息,或者将其写在我的组件.hbs文件或.js文件中的其他位置?

ember.js ember-components

2
推荐指数
1
解决办法
133
查看次数

标签 统计

ember-components ×1

ember.js ×1