Coder Social home page Coder Social logo

element-v-tooltip's Introduction

element-v-tooltip

基于 element-ui Vue2 的 v-tooltip 指令,inspired by v-tooltip

兼容使用 element-ui tooltip 的配置。增加了 overfow 的 modifier,在内容超出了容器才展示 tooltip

安装

npm install element-v-tootip

全局作为 plugin 安装

// main.js
import ElementVTooltip from "element-v-tooltip";

// 如果项目中没有全局引入 element-ui 的样式,则需要手动引入css 
import 'element-v-tooltip/dist/element-v-tooltip.css'

Vue.use(ElementVTooltip);

使用方法

// component.vue
<div v-tooltip.right="'苟利国家生死以'">Hover 出现 tooltip</div>

// or
<div v-tooltip.top.overflow="'只有当文字overflow 才会出现的tooltip'">
  一段有点长的文字23333333333
</div>

// or
<div
  v-tooltip="{
    content: 'random content',
    placement: 'bottom-end',
  }"
>Hover 出现 tooltip</div>

Run Example

npm i && npm run dev

element-v-tooltip's People

Contributors

daolanfler avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

zqhexor

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.