comp-header
v1.1.1
Published
basic react component
Downloads
5
Readme
comp-header
API
| 属性 | 说明 | 类型 | 默认值 | | ---- | ---- | ---- | ---- | | avatarUrl | 用户头像 | String | | | userName | 用户昵称 | String | | | operateMenu | 操作子菜单 | Array[ReactNode] / ReactNode | | | fixed | 固定在顶部 | Boolean | false |
Example
import React from 'react';
import { render } from 'react-dom';
import CompHeader from 'comp-header';
import { Menu } from 'antd';
const { Item } = Menu;
render(
<CompHeader
avatarUrl="https://avatars1.githubusercontent.com/u/11550410?s=400&u=1e8b2ad7d6610154e3b322c6afd9a8bd347a8cc9&v=4"
userName="Frend"
operateMenu={[
<Item key="logout">
<a href="javascript:location.reload();">退出登录</a>
</Item>
]}
/>,
document.getElementById('app')
);
Develop
$ npm run start
Publish
$ cd ../.. // 返回项目根目录,通过 `lerna` 来构建与发布
$ npm run build
$ npm publish