rc-nav

1.0.7 • Public • Published

rc-nav

online demo

Usage

import React from 'react';
import Nav from '../src/nav.tsx';
 
const Item = Nav.Item;
const SubNav = Nav.SubNav;
 
var c=<Nav mode={'horizontal'}>
    <SubNav key={0} title={'菜单1'}>
        <Item key={0}>子选项1</Item>
        <Item key={1}>子选项2</Item>
    </SubNav>
    <Item key={0}>选项1</Item>
    <Item key={1}>选项2</Item>
    <SubNav key={1} title={'菜单1'}>
        <Item key={0}>子选项1</Item>
        <Item key={1}>子选项2</Item>
        <SubNav title={'子菜单'}>
            <Item key={0}>三级选项1</Item>
            <Item key={1}>三级选项2</Item>
        </SubNav>
    </SubNav>
</Nav>

NavProp

mode

type?:'horizontal' | 'vertical' default:'horizontal'

ItemProp

selected

type?:boolean,

onClick

type?:(e: React.SyntheticEvent) => void,

href

type?:string

SubNavProp

onTitleClick?

type:(e: React.SyntheticEvent) => void,

selected

type?: boolean,

display

type?: boolean,

title

type: React.ReactNode,

href

type?: string,

Package Sidebar

Install

npm i rc-nav

Weekly Downloads

1

Version

1.0.7

License

MIT

Unpacked Size

20.4 kB

Total Files

6

Last publish

Collaborators

  • ztx09401515