带有Vuex的Vue店面:从API导入数据

问题描述

我有一个Magento商店,该商店的REST API带有XML数据(常见问题),例如<question>BlaBla</question

我将Vue店面Api配置为呼叫Magento Api并获取所有问题,如下所示:

module.exports = ({ config }) => {
  let m2Api = Router();

  console.log(config.magento2.api.url + '/V1/question/list');
  m2Api.get('/question',(req,res) => {
    request(
      {
        url: config.magento2.api.url + '/V1/question/list',json: false
      },(error,response,body) => {
        let apiResult;
        const errorResponse = error || body.error;
        apiStatus(res,body,200);
      }
    );
  });
  return m2Api;
};

我的Vue Storefront文件夹(magentoRoot / vue-storefront)中也有一个模块,该模块在localhost:3000/faq显示一个页面。我对Vue.js和Vuex绝对陌生,那么如何在模块内的店面页面显示获取的问题呢?

亲切的问候!

解决方法

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

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

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