VueJS popover component based on popper.js
Recommended: https://unpkg.com/vue-popperjs, which will reflect the latest version as soon as it is published to npm. You can also browse the source of the npm package at https://unpkg.com/vue-popperjs/
npm install vue-popperjs --save
yarn add vue-popperjs
bower install vue-popperjs --save
# install dependencies
npm install
# build dist files
npm run build
<template>
<popper
trigger="clickToOpen"
:options="{
placement: 'top',
modifiers: { offset: { offset: '0,10px' } }
}">
<div class="popper">
Popper Content
</div>
<button slot="reference">
Reference Element
</button>
</popper>
</template>
<script>
import Popper from 'vue-popperjs';
import 'vue-popperjs/dist/vue-popper.css';
export default {
components: {
'popper': Popper
},
}
</script>
<link rel="stylesheet" href="vue-popper.css">
<script type="text/javascript" src="popper.js"></script>
<script type="text/javascript" src="vue.js"></script>
<script type="text/javascript" src="vue-popper.js"></script>
<div id="app">
<popper
trigger="clickToOpen"
:options="{
placement: 'top',
modifiers: { offset: { offset: '0,10px' } }
}">
<div class="popper">
Popper Content
</div>
<button slot="reference">
Reference Element
</button>
</popper>
</div>
<script type="text/javascript">
new Vue({
el: '#app',
components: {
'popper': VuePopper
}
});
</script>
Name | Params | Description |
---|---|---|
created | context[Object] | Created popper component |
show | Show popover | |
hide | Hide popover | |
document-click |
Project | Status | Description |
---|---|---|
vue-ls | Vue plugin for work with local storage, session storage and memory storage from Vue context | |
vue-gallery | Responsive and customizable image and video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers |
Author: RobinCK
Live Demo: https://robinck.github.io/vue-popper/
GitHub: https://github.com/RobinCK/vue-popper
#vuejs #javascript #vue #vue-js