Skip to content

Commit

Permalink
Fixed: Cannot redefine property $route
Browse files Browse the repository at this point in the history
  • Loading branch information
hridniev committed Jun 24, 2024
1 parent 560c211 commit a946db9
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions src/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,15 @@ import { createRouter, createWebHistory } from "vue-router";
// Tailwind styles
import "./index.pcss";

// Create vueless instance
const vueless = createVueless();

const router = createRouter({
history: createWebHistory(),
routes: [{ path: "/" }],
});

// Create storybook app instance
const storybookApp = (app) => {
app.use(router);
app.use(vueless);
const vueless = createVueless();
const router = createRouter({ history: createWebHistory(), routes: [] });

if (!app._context.config.globalProperties.$route) {
app.use(router);
app.use(vueless);
}
};

// Setup storybook
Expand All @@ -36,8 +33,6 @@ export default {
backgrounds,
options: {
storySort: (a, b) => {
if (!a.type === "docs") return;

const idA = a.id.split("--")[0];
const idB = b.id.split("--")[0];

Expand Down

0 comments on commit a946db9

Please sign in to comment.