使用解析器中的数据在解析器的另一个属性中读取数据

问题描述

我有一个“菜鸟”问题。但它仍然在这里: 我在阿波罗有一个解析器,像这样:

 ActionDataSet: {

type: (data: ActionDataSet) => data.type,articleName: async (data: ActionDataSet,source: any,{ dataSources }: any) => {
  const result = await dataSources.getProduct(data.value).catch(() => null);
  if (!isNil(result?.title)) {
    return result?.title;
  }
},articlePrice: async (data: ActionDataSet,{ dataSources }: any) => {
  const result = await dataSources.getProduct(data.value).catch(() => null);
  console.log(result?.chainPrice);
  return result?.chainPrice;
},

}, 我在这里返回商品名称和商品价格。那就是说ActionDataSet是数组,并且对于每个元素我都获得商品名称和商品价格。

我的问题是我还有另一个属性,我想在其中获取已经填充的ActionDataSet,然后对所有商品价格进行汇总。但是我无法从一个属性到另一个属性获取数据。这几天我scratch头,我全都没主意。有人可以帮忙吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)