1.0.0 • Published 7 years ago

km-user-popover v1.0.0

Weekly downloads
9
License
ISC
Repository
-
Last release
7 years ago

用户名片组件

安装

npm install --save km-user-popover --registry http://10.240.171.10:4873

使用

import UserPopover from 'km-user-popover'
import 'km-user-popover/styles/css/style.css'

<UserPopover
  requestUrl={`/ps/get_user_info_card?identifier=${author.identifier}`}
  placement="top"
  avatarUrl={`/zone/${author.identifier}`}
  canFollow={author.identifier !== currentUser.identifier}>
    <a href={`/zone/${author.identifier}`}>{author.name}</a>
</UserPopover>

主要参数

nametypedefaultdescription
requestUrlstring数据请求URL
avatarUrlstring用户头像链接URL
canFollowbool能否关注
addFollowUrlstring/follow/add关注接口URL
cancelFollowUrlstring/follow/cancel取消关注接口URL
onFollowSuccessfunction关注成功回调
onFollowErrorfunction关注失败回调
triggerstring[]'hover'显示触发动作,可选'hover','click','focus'
placementstringbottom出现位置,可选'left','right','top','bottom', 'topLeft', 'topRight', 'bottomLeft', 'bottomRight'
0.1.2

7 years ago

1.0.0

7 years ago

0.1.0

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.0

7 years ago