@spryker-vsf/composables
TypeScript icon, indicating that this package has built-in type declarations

0.4.0 • Public • Published

Vue Storefront Composables Layer

Composable is a function that uses Vue.js Composition API under the hood. This is the layer for managing responses from the API layer.

Setting environment

For connecting api/composables layers our theme we have to add common configuration to the nuxt.config.js file.

...
buildModules: [
  [
    "@vue-storefront/nuxt",
    {
      coreDevelopment: true,
      useRawSource: {
        dev: ["@spryker-vsf/composables", "@vue-storefront/core"],
        prod: ["@spryker-vsf/composables", "@vue-storefront/core"]
      }
    }
  ],
  [
      "@spryker-vsf/composables/nuxt",
      {
        baseURL: "{API_URL}",
        locale: "en",
        currency: "EUR",
        currencies: [
          { name: "EUR", label: "Euro" },
          { name: "USD", label: "Dollar" }
        ],
        locales: [
          { name: "en", label: "English" },
          { name: "de", label: "German" }
        ]
      }
    ]
  ],
],
...

Where API_URL is the url for REST API.

Installation

yarn

Development

yarn dev

Production

yarn build

Running unit tests

yarn test

Readme

Keywords

none

Package Sidebar

Install

npm i @spryker-vsf/composables

Weekly Downloads

0

Version

0.4.0

License

MIT

Unpacked Size

1.49 MB

Total Files

374

Last publish

Collaborators

  • spryker-bot