【问题标题】:How to use the new @spartacus/schematics@3.2 schematics?如何使用新的@spartacus/schematics@3.2 原理图?
【发布时间】:2021-05-03 00:18:07
【问题描述】:

我目前正在试用 Spartacus 3.2,但我正在为新的原理图苦苦挣扎。

有关信息 https://sap.github.io/spartacus-docs/building-the-spartacus-storefront-from-libraries/ 与上的信息不符 https://sap.github.io/spartacus-docs/schematics/#adding-spartacus-core-libraries-and-features-to-your-angular-project

  • 我必须选择什么才能获得与 3.1 原理图相同的 b2c 功能?

    • 第一个问题的b2c/b2b选项有什么区别?
    • 为什么“购物车”和“产品”等基本内容甚至作为选项提供?还是因为我选择了“b2c”,所以它们已经被预选了?
    ? Please choose which configuration you would like to add. b2c
    ? Which Spartacus features would you like to setup? (Press <space> to    select, <a> to toggle all, <i> to invert selection)
      ◯ Store Finder
      ◯ Tracking
      ◯ Assisted Services Module
    ❯◯ Cart
      ◯ Organization (b2b feature)
      ◯ Product
      ◯ Product Configurator
    
  • useMetaTags的目的是什么?

  • 如何在命令行上预先选择功能?即如何在没有提示的情况下添加原理图?

【问题讨论】:

    标签: spartacus-storefront


    【解决方案1】:

    我必须选择什么才能获得与 3.1 原理图相同的 b2c 功能

    要进行 b2c 配置,您需要在第一个提示中选择“b2c”配置。这里的“b2c”仅表示一些与b2c相关的配置,与b2c特性无关。 第二个提示将询问您要安装哪些额外的 Spartacus 功能。在这里,如果您不想要任何附加功能,只需按“Enter”即可。例外情况是我们必须安装的新“用户”库。

    为什么“购物车”和“产品”等基本内容甚至作为选项提供?还是因为我选择了“b2c”,所以他们已经预选了?

    这是因为一些客户喜欢将 Spartacus 仅用作目录站点,而没有任何购物车功能(例如)。 目前,这些库仅包含一些与 cart 和 product 相关的额外功能,并且这些功能的核心机制仍然存在于 core 和 storefrontlib 中。这是我们改进代码拆分和延迟加载的努力的一部分。 同样,第二个提示不会根据您在 b2c/b2c 配置之间的选择而改变。

    使用MetaTags的目的是什么?

    我们的文档中解释了元标记:

    useMetaTags determines whether or not to configure the baseUrl and mediaUrl in the meta tags from index.html.
    

    编辑 这实际上意味着什么:
    生成的spartacus-configuration.module.ts 将不包含occ.baseUrl 的任何配置,以确保从元标记加载 URL。

    如何在命令行上预先选择功能?即如何在没有提示的情况下添加原理图?

    要在没有提示的情况下运行@spartacus/schematics,您需要传递--no-interactive 标志。 或者,要在 CLI 上预选功能,您需要传递 --features=feature1 --features=feature2 等,其中功能名称对应于菜单选项名称(例如 --features="Assisted Services Module")

    【讨论】:

      猜你喜欢
      • 2019-08-27
      • 2018-10-01
      • 2019-03-16
      • 2012-12-09
      • 1970-01-01
      • 1970-01-01
      • 2019-04-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多