ember-custom-actions addon urlForCustomAction 不起作用



我正在尝试将 ember-customer-actions(v2.1.0( 插件与我的 ember 版本 = 3.1.4 一起使用。 它真的是一个很酷的插件,在实现客户操作和 url 的同时简化了我们的生活。

它的配置说覆盖此方法"urlForCustomAction"以完成覆盖 url,甚至避免模型名称。

我按照文档说集成了它。 我也在这里发布了我的问题。

这是我的适配器代码:

import ApplicationAdapter from './application'; 
import { AdapterMixin } from 'ember-custom-actions';
export default ApplicationAdapter.extend(AdapterMixin,{
urlForCustomAction(modelName, id, snapshot, actionId, queryParams) {
return 'domain.com/resetPassword';
}
});

似乎缺少某些内容,或者插件中可能存在错误,或者此插件可能处于测试阶段。

我需要快速的帮助,如果有人已经使用它,那么请分享您的经验,谢谢。

尝试在 return 语句之前添加超级调用。

urlForCustomAction(modelName, id, snapshot, actionId, queryParams) {
this._super(...arguments);
return 'domain.com/resetPassword';
}

最新更新