3 |6 | -------------------------------------------------------------------------------- /public/images/sb-nuxt-logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/storybook-vue/storybook-nuxt-demo/HEAD/public/images/sb-nuxt-logo.jpg -------------------------------------------------------------------------------- /components/MyNuxtLink.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 |hello
4 | Hello World 5 |
{{ JSON.stringify( config , null,2 ) }}
5 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/components/MyWelcome.vue:
--------------------------------------------------------------------------------
1 |
2 |
6 | - runtime config {{ JSON.stringify( config,null,2 ) }} -
7 |
8 |
9 |
10 |
13 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Nuxt dev/build outputs
2 | .output
3 | .nuxt
4 | .nitro
5 | .cache
6 | .nuxt-storybook
7 | dist
8 |
9 | # Node dependencies
10 | node_modules
11 |
12 | # Logs
13 | logs
14 | *.log
15 |
16 | # Misc
17 | .DS_Store
18 | .fleet
19 | .idea
20 |
21 | # Local env files
22 | .env
23 | .env.*
24 | !.env.example
25 |
--------------------------------------------------------------------------------
/composables/useMyComposable.ts:
--------------------------------------------------------------------------------
1 | export const useMyComposable = () => {
2 | // Because your composable is called in the right place in the lifecycle,
3 | // useRuntimeConfig will also work
4 | const config = useRuntimeConfig()
5 | console.log('useMyComposable config', config)
6 |
7 | return { config }
8 | }
9 |
--------------------------------------------------------------------------------
/.storybook/preview.ts:
--------------------------------------------------------------------------------
1 | import type { Preview } from "@storybook/vue3";
2 |
3 |
4 | const preview: Preview = {
5 | parameters: {
6 | actions: { argTypesRegex: "^on[A-Z].*" },
7 | controls: {
8 | matchers: {
9 | color: /(background|color)$/i,
10 | date: /Date$/,
11 | },
12 | },
13 | },
14 | };
15 |
16 |
17 | export default preview;
18 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Storybook 7 / Nuxt 3 Demo
2 |
3 | 
4 |
5 |
6 | Look at [Storybook Nuxt](https://github.com/storybook-vue/nuxt) & the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
7 |
8 |
9 |
10 | ## Setup
11 |
12 | ```bash
13 |
14 | pnpm install
15 | pnpm storybook dev
16 |
17 | ```
18 |
19 |
--------------------------------------------------------------------------------
/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from "@storybook-vue/nuxt";
2 | const config: StorybookConfig = {
3 | stories: ["../**/*.mdx", "../**/*.stories.@(js|jsx|mjs|ts|tsx)"],
4 | addons: [
5 | "@storybook/addon-links",
6 | "@storybook/addon-essentials",
7 | "@storybook/addon-interactions",
8 | ],
9 | framework: {
10 | name: "@storybook-vue/nuxt",
11 | options: {},
12 | },
13 | docs: {
14 | autodocs: "tag",
15 | },
16 | };
17 |
18 | export default config;
19 |
--------------------------------------------------------------------------------
/nuxt.config.ts:
--------------------------------------------------------------------------------
1 | // https://nuxt.com/docs/api/configuration/nuxt-config
2 |
3 | export default defineNuxtConfig({
4 | devtools: { enabled: true },
5 | modules: [
6 | '@nuxt/image',
7 | '@pinia/nuxt',
8 | ],
9 | runtimeConfig: {
10 | app: {
11 | name: 'Nuxt',
12 | version: '1.0.0',
13 | baseURL:'/'
14 | },
15 | },
16 | pinia: {
17 | autoImports: ['defineStore', 'acceptHMRUpdate'],
18 | },
19 | imports: {
20 | dirs: ['./stores'],
21 | },
22 | })
23 |
--------------------------------------------------------------------------------
/components/MyNuxtImage.vue:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 | This is an example store to test out devtools. Try one of the following
11 | with the devtools open:
12 |
13 |
32 | Counter: {{ counter.n }}. Double: {{ counter.double }} 33 |
34 | 35 |Increment the Store:
36 | 37 |Other actions:
53 | 54 |counter.changeMe()
58 |
63 | Complete store state via
64 | store.$state:
65 |
{{ counter.$state }}
68 |