UNPKG

cjd-parkball

Version:

> 中后台业务组件库,中后台就像公园,进入需要买门票(登录),所以以 Parkball(公园球) 命名,公园内必定捕获!作为一个组件库,提供使用方法文档,方便开发者的调用

32 lines (25 loc) 712 B
--- category: 2 title: 自定义 onClick 事件 title_en: Customize the onClick event --- 点击锚点不记录历史。 Clicking on an anchor does not record history. ```jsx import { Anchor } from 'parkball'; const { Link } = Anchor; const handleClick = (e, link) => { e.preventDefault(); console.log(link); }; ReactDOM.render( <Anchor affix={false} onClick={handleClick}> <Link href="#components-anchor-demo-basic" title="Basic demo" /> <Link href="#components-anchor-demo-fixed" title="Fixed demo" /> <Link href="#API" title="API"> <Link href="#Anchor-Props" title="Anchor Props" /> <Link href="#Link-Props" title="Link Props" /> </Link> </Anchor>, mountNode); ```