Giter VIP home page Giter VIP logo

vue-tippy's Introduction

VueTippy - V6

npm vue2 download

Vue.js 3 wrapper for Tippy.js

For Tippy.js v4 use v4 branch

Documentation

For full v6 documentation, visit https://vue-tippy.netlify.app/.

Installation

npm install vue-tippy@v6

//or

yarn add vue-tippy@v6

Configuration (optional)

import { createApp } from 'vue'

import VueTippy from 'vue-tippy'
// or
import { plugin as VueTippy } from 'vue-tippy'

const app = createApp({})

app.use(
  VueTippy,
  // optional
  {
    directive: 'tippy', // => v-tippy
    component: 'tippy', // => <tippy/>
  }
)

app.mount('#app')

Usage

Vue Directive

<template>
  <button v-tippy="{ content: 'Hi!' }">Tippy!</button>
  <button v-tippy="'Hello!'">Tippy!</button>
</template>

<!-- 
  The below is optional in case you 
  installed the plugin globally
 -->
<script>
  import { directive } from 'vue-tippy'

  export default {
    directives: {
      tippy: directive,
    },
  }
</script>

Vue Component

<template>
  <tippy content="Hi!">
    <button>Tippy!</button>
  </tippy>
</template>

<!-- 
  The below is optional in case you 
  installed the plugin globally
 -->
<script>
  import { Tippy } from 'vue-tippy'

  export default {
    components: [Tippy],
  }
</script>

Using composition api

import { defineComponent, ref, h } from 'vue'
import { useTippy } from 'vue-tippy'

export default defineComponent({
  setup() {
    const button = ref()

    useTippy(button, {
      content: 'Hi!',
    })

    return () => h('button', { ref: button }, 'Tippy!')
  },
})

vue-tippy's People

Contributors

kabbouchi avatar jaulz avatar abdul-alhasany avatar andercard avatar xico2k avatar raymondmuller avatar stafyniaksacha avatar

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.