npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

v-directive-tooltip

v1.0.2

Published

a tooltip directive with vue2

Downloads

3

Readme

v-tip

基于rollup、ts、vue的自定义指令提示框

参考

vue-directive-tooltip

v-tooltip

特性

  • 支持 dark/light 主题
  • 支持ref形式,提示框可以显示复杂的dom元素。
  • 支持全局默认配置

TODO

  1. 增加手动模式

  2. 增加自动隐藏开关

    目前hover为自动隐藏,click为手动隐藏

  3. 增加上传、npm发布脚本

用法

  1. 安装插件

    npm install -s v-directive-tooltip
  2. 注册为全局组件

    import tip from '@lxw15337674/v-tip';
       
    Vue.use(tip,{directiveName:'tip',theme:'dark'})

    详细全局参数配置

  3. 使用示例:

    <!--  基本模式  -->
    <div v-tip="'test'">test</div>
       
    <!--  基于content属性  -->
    <div v-tip="{
            content: 'test',
            delay: 1000,
            theme:'dark',
            positions: 'top',
            triggers: 'click',
            class: 'tooltip-custom tip',
          }" >
        test
    </div>
       
       
    <!--  基于ref属性  -->
    <div v-tip="{
            ref: 'tipContent',
            delay: 1000,
          }" >
        test
    </div>
    <div ref='tipContent'>
        tipContent
    </div>

    详细参数配置

注册参数

| 参数 | 说明 | 类型 | 是否必填 | 可选值 | 默认值 | | ------------- | ------------------------------------------------------------ | ------ | -------- | -------------------------------------------------- | -------- | | directiveName | 指令名 | String | false | | tip | | theme | 提示框主题 | Object | false | dark | light | dark | | class | 自定义提示框类名,支持连写方式。例如:tip-class1 tip-class2 | String | false | | | | position | 提示框位置 | String | false | right | left | bottom | top | curosr | bottom | | delay | 显示延迟,仅hover触发方式可用 | number | false | | 200 | | offset | 提示框偏移值 | number | false | | 10 | | triggers | 触发方式 | String | false | click | hover | hover |

注册参数一般用于全局配置,优先级低于指令参数。

指令参数

| 参数 | 说明 | 类型 | 是否必填 | 可选值 | 默认值 | | -------- | ------------ | ------ | -------- | ----------------------------------------------------------- | -------- | | content | 提示框内容 | string | false | | | | ref | 通过ref属性传递提示框内容 | string | false | | | | theme | 提示框主题 | Object | false | dark | light | dark | | class | 自定义提示框类名,支持连写方式。例如:tip-class1 tip-class2 | String | false ||| | position | 提示框位置 | String | false | right | left | bottom | top | curosr | bottom | | delay | 显示延迟,仅hover触发方式可用 | number | false | | 200 | | offset | 提示框偏移值 | number | false | | 10 | | triggers | 触发方式 | String | false | click | hover | hover |

注意: ref属性优先级低于content属性

暂存问题

ref内容模式:

  • 多个tip引用一个ref,只有第一个tip会正常引用
  • 动态修改ref,不会变化。
  • ref引用的元素有v-tip指令,tip会被元素本身遮挡,所以不建议使用cursor模式