1

我正在尝试将 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';

}

});

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

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

4

1 回答 1

0

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

urlForCustomAction(modelName, id, snapshot, actionId, queryParams) {

    this._super(...arguments);
    return 'domain.com/resetPassword';

}
于 2018-06-01T09:26:53.290 回答