2 |
3 |
Settings
4 | {{ settings }}
5 |
6 |
7 |
8 |
11 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | indent_size = 2
5 | indent_style = space
6 | end_of_line = lf
7 | charset = utf-8
8 | trim_trailing_whitespace = true
9 | insert_final_newline = true
10 |
11 | [*.md]
12 | trim_trailing_whitespace = false
13 |
--------------------------------------------------------------------------------
/playground/nuxt.config.ts:
--------------------------------------------------------------------------------
1 | import { defineNuxtConfig } from 'nuxt/config'
2 | import Swell from '..'
3 |
4 | export default defineNuxtConfig({
5 | modules: [
6 | Swell
7 | ],
8 | swell: {
9 | storeId: process.env.STORE_ID,
10 | apiKey: process.env.SWELL_PUBLIC_KEY
11 | }
12 | })
13 |
--------------------------------------------------------------------------------
/src/runtime/plugin.ts:
--------------------------------------------------------------------------------
1 | import { defineNuxtPlugin, useRuntimeConfig } from '#app'
2 | import swell from 'swell-js'
3 |
4 | export default defineNuxtPlugin((nuxtApp) => {
5 | const { storeId, apiKey, options } = useRuntimeConfig().public.swell
6 | swell.init(storeId, apiKey, options)
7 | nuxtApp.provide('swell', swell)
8 | })
9 |
--------------------------------------------------------------------------------
/playground/pages/products/[slug].vue:
--------------------------------------------------------------------------------
1 |