# @livelybone/vue-popper

> A vue component of popper.js, and the arrow position control is implemented

Latest version **2.4.0** (published 2020-05-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @livelybone/vue-popper
pnpm add @livelybone/vue-popper
yarn add @livelybone/vue-popper
bun add @livelybone/vue-popper
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.4.0 |
| Published | 2020-05-17 |
| First published | 2018-09-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 49.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | 2631541504@@qq.com |
| Maintainers | livelybone |
| Keywords | vue, popper |

## Links

- npm: https://www.npmjs.com/package/@livelybone/vue-popper
- Repository: https://github.com/livelybone/vue-popper
- Homepage: https://livelybone.github.io/vue/vue-popper/
- Issues: https://github.com/livelybone/vue-popper/issues
- npm.io page: https://npm.io/package/@livelybone/vue-popper

## Dependencies (1)

- [popper.js](https://npm.io/package/popper.js.md) ^1.14.4

## Recent versions

- 2.4.0 (latest) — 2020-05-17
- 2.3.1 — 2019-08-01
- 2.3.0 — 2019-08-01
- 2.2.2 — 2019-06-06
- 2.2.1 — 2019-04-17
- 2.2.0 — 2019-04-17
- 2.1.0 — 2019-01-10
- 2.0.1 — 2019-01-07
- 2.0.0 — 2018-12-26
- 1.6.0 — 2018-09-18
- 1.5.0 — 2018-09-07
- 1.4.0 — 2018-09-07
- 1.3.2 — 2018-09-07
- 1.3.1 — 2018-09-07
- 1.3.0 — 2018-09-07
- … 3 more at https://npm.io/package/@livelybone/vue-popper/versions

## README

# @livelybone/vue-popper
[![NPM Version](http://img.shields.io/npm/v/@livelybone/vue-popper.svg?style=flat-square)](https://www.npmjs.com/package/@livelybone/vue-popper)
[![Download Month](http://img.shields.io/npm/dm/@livelybone/vue-popper.svg?style=flat-square)](https://www.npmjs.com/package/@livelybone/vue-popper)
![gzip with dependencies: 8.8kb](https://img.shields.io/badge/gzip--with--dependencies-8.8kb-brightgreen.svg "gzip with dependencies: 8.8kb")
![typescript](https://img.shields.io/badge/typescript-supported-blue.svg "typescript")
![pkg.module](https://img.shields.io/badge/pkg.module-supported-blue.svg "pkg.module")

> `pkg.module supported`, which means that you can apply tree-shaking in you project

[中文文档](./README-CN.md)

A vue component of popper.js, and the arrow position control is implemented

## repository
https://github.com/livelybone/vue-popper.git

## Demo
https://livelybone.github.io/vue/vue-popper/

## Run Example
Your can see the usage by run the example of the module, here is the step:

1. Clone the library `git clone https://github.com/livelybone/vue-popper.git`
2. Go to the directory `cd your-module-directory`
3. Install npm dependencies `npm i`(use taobao registry: `npm i --registry=http://registry.npm.taobao.org`)
4. Open service `npm run dev`
5. See the example(usually is `http://127.0.0.1:3000/examples/test.html`) in your browser

## Installation
```bash
npm i -S @livelybone/vue-popper
```

## Global name - The variable the module exported in `umd` bundle
`VuePopper`

## Interface
See what method or params you can use in [index.d.ts](./index.d.ts)

## Usage
```js
import VuePopper from '@livelybone/vue-popper'
import '@livelybone/vue-popper/lib/css/index.css';

// Global register
Vue.component('VuePopper', VuePopper)

// Local register
new Vue({
  components:{VuePopper}
})
```

## Props
| Name                    | Type                                      | DefaultValue              | Description  |
| ----------------------- | ----------------------------------------- | ------------------------- | ------------ |
| `arrowPosition`         | `String`                                  | `middle`                  | Set the position of arrow, options: `middle start end`  |
| `arrowOffsetScaling`    | `Number`                                  | `window.devicePixelRatio` or `1`                       | Set the left offset scaling of arrow  |
| `referenceElm`          | `HTMLElement`                             | the parentNode of the component instance              | Prop `reference` of popper.js  |
| `popperOptions`         | `Object`                                  | Defaults of popper.js     | Prop `options` of popper.js |

## style
Since 2.3.0， you don't need to import the css file in your project, because the style will be injected inline

For rewrite style, you can copy the `index.scss` or `index.css` file, rewrite it, and the import the file in your project

## QA

1. Error `Error: spawn node-sass ENOENT`

> You may need install node-sass globally, `npm i -g node-sass`

---
_Source: https://npm.io/package/@livelybone/vue-popper · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
