# vue-msgs

> A vue component of message

Latest version **1.0.6** (published 2019-04-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-msgs
pnpm add vue-msgs
yarn add vue-msgs
bun add vue-msgs
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2019-04-24 |
| First published | 2019-01-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | TheoXiong |
| Maintainers | theoxiong |
| Keywords | message, msg, vue |

## Links

- npm: https://www.npmjs.com/package/vue-msgs
- Repository: https://github.com/TheoXiong/vue-msgs
- Homepage: https://github.com/TheoXiong/vue-msgs#readme
- Issues: https://github.com/TheoXiong/vue-msgs/issues
- npm.io page: https://npm.io/package/vue-msgs

## Recent versions

- 1.0.6 (latest) — 2019-04-24
- 1.0.5 — 2019-02-14
- 1.0.4 — 2019-02-12
- 1.0.3 — 2019-01-29
- 1.0.2 — 2019-01-29
- 1.0.1 — 2019-01-29
- 1.0.0 — 2019-01-29

## README

# vue-msgs

## Introduction
 [vue-msgs](https://theoxiong.github.io/vue-msgs) is a vue component of message, you can show message by call the method of showMsg, and it will hidden when timeout.

## Install
``` 
$   npm install vue-msgs --save
```

## Usage

#### import with ES6
```
import VueMsg from 'vue-msgs'
```

#### or commonJs 
```
const VueMsg = require('vue-msgs').default
```

#### global registration
1. used by default
```
Vue.use(VueMsg)
Vue.prototype.$showMsg('success', 'this is a message')  // in app
this.$showMsg('success', 'this is a message')  // in component
```
2. change props
```
Vue.use(VueMsg, {
  timeout: 2000,  // duration of message view
  top: 100, // offset to top of document
  right: 20 // offset to right of document
})
```
3. diable register
```
Vue.use(VueMsg, {
  register: false,  // will not call Vue.component('VueMsg', VueMsg)
})
```

#### local registration
```
<vue-msg ref="vueMsg"></vue-msg>
components: { VueMsg }
this.$refs.vueMsg.showMsg('success', 'this is a message')
```


#### there is a simply demo
```
npm install
npm run dev

```

## Methods
name | brief |  param   
-|-|-   
showMsg | open the message interface | type: the type of message, support 'success'/'info'/'warning'/'error', info: the content of message |

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