diff --git a/.storybook/preview.ts b/.storybook/preview.ts index 4748012..162ac21 100644 --- a/.storybook/preview.ts +++ b/.storybook/preview.ts @@ -7,6 +7,7 @@ import { type App } from "vue"; import { EventsPlugin } from "../src/eventBus/events"; import { createPinia } from "pinia"; import { navIsLoading } from "../src/router"; +import { vueRouter } from "storybook-vue3-router"; setup((app: App) => { app.use(createPinia()); @@ -29,4 +30,10 @@ const preview: Preview = { }, }; +preview.decorators = [ + /* this is the basic setup with no params passed to the decorator */ + vueRouter(), +]; + + export default preview; diff --git a/src/stories/BaseButton.stories.ts b/src/stories/BaseButton.stories.ts index 6ca3871..1f1d9c5 100644 --- a/src/stories/BaseButton.stories.ts +++ b/src/stories/BaseButton.stories.ts @@ -2,8 +2,6 @@ import type { Meta, StoryObj } from "@storybook/vue3"; import BaseButton from "@/components/BaseButton.vue"; -import { vueRouter } from "storybook-vue3-router"; - // More on how to set up stories at: https://storybook.js.org/docs/writing-stories const meta: Meta = { title: "Components/BaseButton", @@ -44,9 +42,3 @@ export const UsingToProp: Story = { to: "/", }, }; - -/* adding storybook-vue3-router decorator */ -UsingToProp.decorators = [ - /* this is the basic setup with no params passed to the decorator */ - vueRouter(), -]; diff --git a/src/stories/NavBar.stories.ts b/src/stories/NavBar.stories.ts index 142e02a..e295c7c 100644 --- a/src/stories/NavBar.stories.ts +++ b/src/stories/NavBar.stories.ts @@ -2,7 +2,6 @@ import type { Meta, StoryObj } from "@storybook/vue3"; import NavBar from "@/components/NavBar.vue"; -import { vueRouter } from "storybook-vue3-router"; import { useUserStore } from "@/stores/user"; // More on how to set up stories at: https://storybook.js.org/docs/writing-stories @@ -38,16 +37,3 @@ export const LoggedOut: Story = { href: "/", }, }; - -/* adding storybook-vue3-router decorator */ -LoggedIn.decorators = [ - /* this is the basic setup with no params passed to the decorator */ - /* this is the basic setup with no params passed to the decorator */ - vueRouter(), -]; - -/* adding storybook-vue3-router decorator */ -LoggedOut.decorators = [ - /* this is the basic setup with no params passed to the decorator */ - vueRouter(), -];