# vue-bootalert

> VueJS component for generating Bootstrap alerts

Latest version **0.0.1** (published 2017-08-23) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2017-08-23 |
| First published | 2017-08-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | craig@harmonic.com.au |
| Maintainers | craigharman |
| Keywords | VueJs, alert, bootstrap, message |

## Links

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

## Alternatives

- [@sveltejs/kit](https://npm.io/package/@sveltejs/kit.md) — 2.2M weekly downloads
- [@tangle-network/brand](https://npm.io/package/@tangle-network/brand.md) — 10.0K weekly downloads
- [seneca](https://npm.io/package/seneca.md) — 7.4K weekly downloads
- [@bsb/base](https://npm.io/package/@bsb/base.md) — 7.2K weekly downloads
- [@modern-js/plugin-swc](https://npm.io/package/@modern-js/plugin-swc.md) — 3.4K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2017-08-23

## README

# vue-bootalert
VueJS component for generating Bootstrap alerts

## Installation

``` bash
# install with npm
npm install vue-bootalert --save
```

``` javascript
var VueBootalert = require('vue-bootalert')
Vue.use(VueBootalert)
```
## Usage

Add as a component:

``` javascript
components: {
    VueBootalert
}
```
You can then create an alert with:

``` html
<bootalert message="Your message here"></bootalert>
```

You can configure the alert with the following parameters:

| Name  | Description |  Required | Allowed Values | Type | Default Value  |
|---|---|---|---|---|---|
| type  |  The alert style, taken from Bootstrap alert classes |  N | info, warning, success, danger  | String  |  info |
| message | The message to display in the alert | Y  | Text/HTML | String  | nil  |
| shouldDisappear  | The alert should disappear automatically after a period of time  | N | true, false  | Boolean  | true |
| displayTime  | The time in miliseconds the message should stay on screen for (if shouldDisappear is set to true)  | N |   | Integer | 5000 |
| alertDismissable  | Allow the user to close the alert by clicking on X  | N | Dismissable if present |   |  false |

## Examples

### Basic Usage

``` HTML
<bootalert type="danger" message="test message 1 (dismisable)" shouldDisappear="false" alertDismissable></bootalert>
<bootalert type="success" message="test message 2"></bootalert>
```

### Dynamically creating alerts

``` HTML
<bootalert v-for="(alert,index) in alerts" :key="index" v-bind:type="alert.type" v-bind:message="alert.message" v-bind:shouldDisappear="alert.shouldDisappear" alertDismissable></bootalert>
```

``` Javascript
export default {
    data: function() {
      return {
        alerts: []
      }
    },
    methods: {
      createErrorAlert: function(message) {
        this.alerts.push({
          type: 'danger',
          message: message,
          shouldDisappear: false
        });
      }
    }
}

// Then call createErrorAlert when you want a new message
createErrorAlert("Your message here")
```

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