Ember.js 余烬把手:查找定义组件/辅助对象/变量的位置
给出一些把手代码如下:Ember.js 余烬把手:查找定义组件/辅助对象/变量的位置,ember.js,handlebars.js,Ember.js,Handlebars.js,给出一些把手代码如下: {{ui.select param1="foo" param2="bar"}} {{#my-component as |ui|}} {{ui.select ...}} {{/my-component}} 我如何找到定义了ui.select的位置 (我正好在Ember 2.13上)因为它包含一个来自上下文组件 因此,首先找出ui的来源。也许你有这样的想法: {{ui.select param1="foo" param2="bar"}} {{#my-componen
{{ui.select param1="foo" param2="bar"}}
{{#my-component as |ui|}}
{{ui.select ...}}
{{/my-component}}
我如何找到定义了ui.select的位置
(我正好在Ember 2.13上)因为它包含一个
来自上下文组件
因此,首先找出ui
的来源。也许你有这样的想法:
{{ui.select param1="foo" param2="bar"}}
{{#my-component as |ui|}}
{{ui.select ...}}
{{/my-component}}
然后你必须检查my component
并找出ui
在{yield}
中分配给了什么。如果这真的是找到这些东西的最好方法,我会喜欢一些常用的正则表达式来为助手找到把手定义:搜索.js
文件:export default Ember.Helper
(旧语法)和export default Helper(
(新语法)。对于组件,请按名称搜索.hbs
文件。这就是诀窍!谢谢Lux。(编辑:转到新问题,稍后将链接)我在关于查找插件定义的帮助程序的问题中添加了第二部分,如果您愿意,我可以将其移至一个新问题,但我认为最好将问题集中一点。@ctcphere是第二个问题: