手动建立storybook
1. Add @storybook/react
npm i --save-dev @storybook/react
2. Add react, react-dom, and babel-core
npm i --save react react-dom
npm i --save-dev babel-core
3. Then add the following NPM script to your package json in order to start the storybook later in this guide
{
"scripts": {
"storybook": "start-storybook -p 9001 -c .storybook"
}
}
4. Create the config file
To do that, simply create a file at .storybook/config.js with the following content:
import { configure } from '@storybook/react';
function loadStories() {
require('../stories/index.js'); // You can require as many stories as you need.
}
configure(loadStories, module);
5. Write your stories
Now you can write some stories inside the ../stories/index.js file, like this:
import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import Button from '../components/Button'; storiesOf('Button', module)
.add('with text', () => (
<Button onClick={action('clicked')}>Hello Button</Button>
))
.add('with some emoji', () => (
<Button onClick={action('clicked')}><span role="img" aria-label="so cool">手动建立storybook的更多相关文章
- 手动建立mapping以及增加属性
只能创建index时手动建立mapping,或者新增field mapping,但是不能update field mapping 1.手动建立mappingPUT /website{ "ma ...
- Oracle XE手动建立数据库实例
参考资料为: [Oracle XE系列之三]使用OMF方式手工创建Oracle XE数据库 - 王立夫 - 博客园http://www.cnblogs.com/opfo/p/5056122.html ...
- Quarter square 查找表乘法器,手动建立rom
建立一个C的范围为0~255,内容是(C)2/4的查表 占用256个存储空间,但可以计算出+-127的两个数之积.传统算法需要至少127×127个存储空间. 查找表模块的建立: module lut_ ...
- keystone 手动建立租户,用户,角色,服务,端口
建立租户: root@cloud:~# keystone tenant-create --name=admin WARNING: Bypassing authentication using a to ...
- 手动建立数据库连接的BaseDAO
package com.chinasoft.julong.dao; import java.sql.Connection; import java.sql.DriverManager; import ...
- Linux中yum手动安装、手动建立仓库文件夹关联实现关联包自动安装、yum相关命令使用
yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能够从指 ...
- LINUX 手动建立SWAP文件及删除
原文:http://blog.itpub.net/7728585/viewspace-670175/ 1. 确定swap文件的大小,单位为M.将该值乘以1024得到块大小.例如,64MB的swap文件 ...
- 【转】LINUX 手动建立SWAP文件及删除
如何在红帽 企业版Linux系统中添加swap文件? 解决方法: 1. 确定swap文件的大小,单位为M.将该值乘以1024得到块大小.例如,64MB的swap文件的块大小是65536. 2. 在ro ...
- Ubuntu14.04下手动建立快捷方式
先在桌面创建一个文件:文件内容如下 [Desktop Entry]Encoding=UTF-8Name=eclipseComment=eclipse ideExec=/home/mars/eclips ...
随机推荐
- 出现函数重载错误call of overloaded ‘printfSth(double)’ is ambiguous
class C: { public: void printfSth(int i) { cout<<"C::printfSth(int i):"<<i< ...
- c++ set容器排序准则
转载两篇博客: http://blog.csdn.net/lishuhuakai/article/details/51404214 http://blog.csdn.net/lihao21/artic ...
- [BZOJ1034][ZJOI2008]泡泡堂BNB 贪心
1034: [ZJOI2008]泡泡堂BNB Time Limit: 10 Sec Memory Limit: 162 MB Submit: 3414 Solved: 1739 [Submit][ ...
- 微信小程序实现豆瓣读书
个人练习项目,使用了scss+webstorm watcher来处理样式.整体上没有什么难点. github:https://github.com/axel10/wx-douban-read
- POJ 2528.Mayor's posters-线段树(成段替换、离散数据、简单hash)
POJ2528.Mayor's posters 这道题真的是线段数的经典的题目,因为数据很大,直接建树的话肯定不可以,所以需要将数据处理一下,没有接触离散化的时候感觉离散化这个东西相当高级,其实在不知 ...
- UVA 1151 Buy or Build MST(最小生成树)
题意: 在平面上有n个点,要让所有n个点都连通,所以你要构造一些边来连通他们,连通的费用等于两个端点的欧几里得距离的平方.另外还有q个套餐,可以购买,如果你购买了第i个套餐,该套餐中的所有结点将变得相 ...
- java.sql.SQLException: Access denied for user 'roo'@'localhost' (using password: YES)
初学mysql,安装了mysql8.0.11,激动的用jdbc连接数据库,出现error,折腾了三天依旧无解,最后无奈装了比较稳定的mysql5.5,问题得以解决,很迷,但只要error没了就开心. ...
- Ribbon负载均衡(四)
一.Ribbon定义 spring cloud Ribbon是基于Netflix Ribbon实现的一套客户端,负载均衡工具 简单的说,Ribbon是Netflix发布的开源项目,主要功能是提供客户端 ...
- spoj 913 Query on a tree II (倍增lca)
Query on a tree II You are given a tree (an undirected acyclic connected graph) with N nodes, and ed ...
- [POI2010]Beads
题目大意: 给定一个长度为$n(n\leq200000)$的串$S_{1\sim n}$,选择一个$l$,从$S_1$开始,将$S$分为连续的若干段,使得每一段长度为$l$.令$k$为分出来不同的子串 ...