# @mathewparet/vue-bs-disabled

> A Vue.Js directive to disable bootstrap controls

Latest version **1.0.12** (published 2018-12-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mathewparet/vue-bs-disabled
pnpm add @mathewparet/vue-bs-disabled
yarn add @mathewparet/vue-bs-disabled
bun add @mathewparet/vue-bs-disabled
```

## 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.12 |
| Published | 2018-12-19 |
| First published | 2018-12-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 24.6 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Mathew Paret |
| Maintainers | mathewparet |

## Links

- npm: https://www.npmjs.com/package/@mathewparet/vue-bs-disabled
- Repository: https://github.com/mathewparet/vue-bs-disabled
- Homepage: https://github.com/mathewparet/vue-bs-disabled#readme
- Issues: https://github.com/mathewparet/vue-bs-disabled/issues
- npm.io page: https://npm.io/package/@mathewparet/vue-bs-disabled

## Dependencies (1)

- [vue](https://npm.io/package/vue.md) ^2.5.11

## Recent versions

- 1.0.12 (latest) — 2018-12-19

## README

# @mathewparet/vue-bs-disabled

> A Vue.Js directive to disable bootstrap controls. Unlike normal disable property of control buttons, bootstrap requires disabled added to the class to get the control to be disabled. This is useful mostly when you need to disable some controls in VUE based on certain conditions.

## Build Setup

``` bash
# install dependencies
npm install

# build for production with minification
npm run build
```

## Installation
``` bash
npm i @mathewparet/vue-bs-disabled
```

## Initial Configuration Usage

``` js
// In your App.js
import Vue from 'vue';
import BsDisabled from '@mathewparet/vue-bs-disabled';
Vue.use(BsDisabled)
```

To use the directive simply add ```v-bs-disabled``` to the corresponding element with the required condition.

## Simple Usage Example

``` html
<div>
    <a class="btn btn-primary" v-bs-disabled="1==1">This button is disabled</a><br>
    <a class="btn btn-primary" v-bs-disabled="1==0">This button is enabled</a><br>
    <a class="btn btn-primary" v-bs-disabled.hidden="1==1">This button is hidden</a><br>
    <a class="btn btn-primary" v-bs-disabled.hidden="1==0">This button is enabled + visible</a><br>
</div>
```

## Advanced Usage Example

``` html
<div>
    <a class="btn btn-primary" v-bs-disabled="{hidden: false, condition: 1==1}">This button is disabled</a><br>
    <a class="btn btn-primary" v-bs-disabled="{hidden: false, condition: 1==0}">This button is enabled</a><br>
    <a class="btn btn-primary" v-bs-disabled="{hidden: true, condition: 1==1}">This button is hidden</a><br>
    <a class="btn btn-primary" v-bs-disabled="{hidden: true, condition: 1==0}">This button is enabled + visible</a><br>
</div>
```

### Note

When both ```.hidden``` modifier and the ```hidden``` property of the ```v-bs-disabled``` directives are present, then the element is **hidden** if the condition evaluates to ```true```.

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