nsky-legend
v0.0.2
Published
Nsky Component
Downloads
1
Maintainers
Readme
nsky-legend 图例组件
Nsky Common Component
Screenshots
install
dnpm install nsky-legend --save-dev
Usage
import NskyLegend from 'nsky-legend'
import React from 'react'
import ReactDOM from 'react-dom'
import 'nsky-legend/dist/index.css'
ReactDOM.render(<NskyLegend />, container)
API
props
name | type | default | description | -----|------|---------|--------------| legends | Array | [] | 图例的数据来源,内部对象包含color/des/title属性 | direction | String | 'horizontal' | 展示形态,可分横向和纵向 | isShow | Boolean | false | 是否显示,外部控制nsky-legend的显示隐藏 | position | Object | {} | 控制组件位置, 内部对象包含left/top/right/bottom | className | String | null | 增加组件的类名 |
legends 配置示例
[{
color: '#7ED321',
des: '已发布',
title: '可选'
}, {
color: '#9B9B9B',
des: '未发布',
title: '可选'
}]
Development
npm install
npm run example