DEV Community

reoring
reoring

Posted on

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

Top comments (0)