0.1.102 • Published 6 years ago

@beisen/tool-tip v0.1.102

Weekly downloads
28
License
ISC
Repository
gitlab
Last release
6 years ago

ToolTip使用说明

功能

用于文字提示

使用说明

tip默认向上显示,当向上显示不下时,会向下显示  

使用方法

1. 将组件包裹在需要有提示信息的元素的外部,每个组件内部只能有一个元素
2. 适用于行内元素 如input、button、a和有span包裹的文字等  
3. 一般情况下只需要设置title值即可
4. 可以传简易的html标签  

项目运行、打包

* `cnpm install` 或 `npm install`
* `npm run dev` (开发环境打包 port:8080)
* `npm run build` (生产环境打包)  

使用参数

  • title : 提示内容 //需要提示的内容文字,必须是字符串
  • hidden: 组件是否隐藏 可选参数 :true,false 默认不隐藏, 可不设置
  • side :组件是否左右显示 可选参数 true ,false 默认为false 可不设置,一般情况下均为false
  • alwaysShowTips: 总是显示tooltip,默认为false,该参数和组件显示特性有关(该组件只有当包裹文字宽度大于外部宽度,即出现...这种显示不全的情况下才会显示tooltip)
  • htmlTag: 数组格式,['<center>', '<a>'] 为防止xss攻击,自定义允许渲染的html标签,组件内默认为 <span>,<p>,</br>,<br/> 凡是含有其他标签的字符串,均不会处理为html
  • tipsPosition: 'bottom' 目前仅支持bottom参数,当设置该参数为bottom时,tips会向下显示, 默认为自适应判断
  • tipsReason: "功能说明" 如果有该参数,未打点情况下会优先显示该参数,打点情况下会显示两行说明,如下显示
  • 名称
  • B: 说明

  • tipsDes: "功能描述", 自定义前置描述 B

ToolTip组件调用方法

1.安装npm组件包

npm install @beisen/tool-tip --save-dev  

2.引用组件

import ToolTip from "src/index"  

3.传入参数
该参数为上述参数,传入方式使用: {...参数}

export default class TestToolTip extends React.Component {
    constructor(props){
        super(props)
    }
    render() {
        let data = {
            title: '提示内容',
            hidden: false,
            side: true,
            alwaysShowTips: true,
            tipsPosition: 'buttom',
            htmlTag: ["<span>"], //组件内默认为 <span>,<p>,</br>,<br/>凡是含有其他标签的字符串,均不会处理为html
            tipsReason: 'reason',
            tipsDes: "des" 
        }
        return(
            <div> 
                <ToolTip {...data}> 
                    <input />
                </ToolTip>
            </div>
         ) 
    }
}  
    <ToolTip title='提示内容'> 
      <a href="#">内容热区</a>
    </ToolTip>
    <ToolTip title={data} side={true}> 
      <span>内容热区<span>  //左右自适应显示
    <ToolTip>
    <ToolTip title={v.text}> 
      <img href="#">内容热区 />
    </ToolTip>
@infinitebrahmanuniverse/nolb-_beisen_@everything-registry/sub-chunk-119test-searchformux-online-user-viewux-pagebuilderux-performance-process-snapshotux-person-evaluation-resultux-person-last-alldeg-scoreux-person-last-alldeg-scoresux-person-last-evaluation-scoreux-plan-completion-rateux-platform-treeux-platform-user-selector-dragux-platform-form-containerux-platform-ocean-table-mobileux-m-last-alldeg-scoreux-m-last-evaluation-scoreux-m-performance-historyux-m-report-alldeg-scoreux-m-report-evaluation-scoreux-m-user-infosux-medalux-my-bountyux-my-meetting-componentux-my-todo-viewux-italent-appux-jobs-pageux-last-test-resultsux-last-thas-resultux-company-announcementux-company-key-wordux-compapy-tags-order-coux-create-projectux-diligence-listux-card-page-templateux-evaluation-reportsux-feature-avatarux-reward-wrapux-search-formux-solutionux-test-pageux-test-with-router-pageux-text-imageux-thunder-calendarux-tms-popupux-todo-listux-universal-user-infoux-user-basic-infoux-user-basic-infosux-user-selector2ux-tub-tmpl-task-weekux-tub-tmpl-userux-tub-tmpl-work-statisticalux-tag-cloudux-task-drawerux-task-listux-remain-annual-leaveux-report-last-evaluation-resultux-reward-order-compux-vacation-balanceux-week-daily-statisticsux-week-task-completionux-work-calendarux-work-report-drawerux-attachment-new-typeux-attachment-typesux-banner-componentux-bounty-increase-tree-compux-abnormal-attendanceux-addetail-page@beisen/lookup-v2@beisen/time-picker@beisen/recruit-dropdown-list@beisen/ux-company-announcement@beisen/ux-computationrule@beisen/ux-reward@beisen/ux-upaas-ethos@beisen/tub-tmpl-work-statisticalitalent-attachmentlistitalent-create-taskitalent-feed-14italent-portalitalent-share-boxitalent-task-operate-areaitalent-task-tab-titleitalent-user-selectux-caption-componentstita-react-componentstita-talentui@beisen-cmps/italent-feedmix-components@beisen-cmps/italent-task-common-component@beisen-cmps/italent-attachmentlist@beisen-cmps/italent-create-summary@beisen-cmps/italent-create-task@beisen-cmps/italent-feed-13@beisen-cmps/italent-feed-14@beisen-cmps/italent-feed-20@beisen-cmps/natureui-area@beisen-cmps/natureui-button@beisen-cmps/natureui-cascader
0.1.102

6 years ago

0.1.101

6 years ago

0.1.100

6 years ago

0.1.99

6 years ago

0.1.98

6 years ago

0.1.97

6 years ago

0.1.96

6 years ago

0.1.95

6 years ago

0.1.94

6 years ago

0.1.93

6 years ago

0.1.92

6 years ago

0.1.91

6 years ago

0.1.90

6 years ago

0.1.89

6 years ago

0.1.88

6 years ago

0.1.87

6 years ago

0.1.86

6 years ago

0.1.85

6 years ago

0.1.84

6 years ago

0.1.83

7 years ago

0.1.82

7 years ago

0.1.81

7 years ago

0.1.80

7 years ago

0.1.79

7 years ago

0.1.78

7 years ago

0.1.77

7 years ago

0.1.76

7 years ago

0.1.75

7 years ago

0.1.74-1

7 years ago

0.1.74

7 years ago

0.1.73

7 years ago

0.1.72

7 years ago

0.1.71

7 years ago

0.1.69

7 years ago

0.1.68

7 years ago

0.1.67

7 years ago

0.1.66

7 years ago

0.1.65

7 years ago

0.1.64

7 years ago

0.1.63

7 years ago

0.1.62

7 years ago

0.1.61

7 years ago

0.1.60

7 years ago

0.1.59

7 years ago

0.1.58

7 years ago

0.1.56

7 years ago

0.1.55

7 years ago

0.1.54

7 years ago

0.1.53

7 years ago

0.1.52

7 years ago

0.1.51

7 years ago

0.1.50

7 years ago

0.1.49

7 years ago

0.1.48

7 years ago

0.1.47

7 years ago

0.1.46

8 years ago

0.1.45

8 years ago

0.1.44

8 years ago

0.1.43

8 years ago

0.1.42

8 years ago

0.1.41

8 years ago

0.1.40

8 years ago

0.1.39

8 years ago

0.1.38

8 years ago

0.1.37

8 years ago

0.1.36

8 years ago

0.1.35

8 years ago

0.1.34

8 years ago

0.1.33

8 years ago

0.1.32

8 years ago

0.1.31

8 years ago

0.1.30

8 years ago

0.1.29

8 years ago

0.1.28

8 years ago

0.1.27

8 years ago

0.1.26

8 years ago

0.1.25

8 years ago

0.1.24

8 years ago

0.1.23

8 years ago

0.1.22

8 years ago

0.1.21

8 years ago

0.1.18

8 years ago

0.1.17

8 years ago

0.1.16

8 years ago

0.1.15

8 years ago

0.1.14

8 years ago

0.1.12

8 years ago

0.1.11

8 years ago

0.1.10

8 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago