DEV Community

reoring
reoring

Posted on

8

Use Storybook with Vuejs

Screen Shot 2017-08-21 at 17.08.26.png

Storybook Since 3.2, support for Vuejs has been added, so I will try using it at once.

Storybook is a tool that makes it easy to create catalogs of components, cataloging self-made components in the project and how to use it.

Screen Shot 2017-08-21 at 16.54.49.png

Installation of storybook / cli

npm i - g @ storybook / cli
Enter fullscreen mode Exit fullscreen mode

Prepared by existing Vuejs project

cd Directory where vuejs project is located
Enter fullscreen mode Exit fullscreen mode

Installing the storybook

getstorybook
Enter fullscreen mode Exit fullscreen mode

Start storybook server

yarn run storybook
Enter fullscreen mode Exit fullscreen mode

In this state, opening http://localhost:6006/ opens the default setting screen.

Add component

To add a component to a storybook, add a definition to index.js in thestories directory created with getstorybook.

You can change this stories directory by editing.storybook / config.js.

Reference material

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Sentry image

See why 4M developers consider Sentry, β€œnot bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more