# neutronium-vue-command-mixin

> Vue mixin to integrate MVVM ICommand with vue.js

Latest version **1.5.0** (published 2017-10-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install neutronium-vue-command-mixin
pnpm add neutronium-vue-command-mixin
yarn add neutronium-vue-command-mixin
bun add neutronium-vue-command-mixin
```

## 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.5.0 |
| Published | 2017-10-07 |
| First published | 2016-11-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | David |
| Maintainers | davidesmaisons |
| Keywords | vue.js, Neutronium, command |

## Links

- npm: https://www.npmjs.com/package/neutronium-vue-command-mixin
- Repository: https://github.com/NeutroniumCore/neutronium-vue-command-mixin
- Homepage: https://github.com/NeutroniumCore/neutronium-vue-command-mixin#readme
- Issues: https://github.com/NeutroniumCore/neutronium-vue-command-mixin/issues
- npm.io page: https://npm.io/package/neutronium-vue-command-mixin

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.5.0 (latest) — 2017-10-07
- 1.4.3 — 2017-10-07
- 1.4.2 — 2017-10-07
- 1.4.1 — 2017-10-07
- 1.4.0 — 2017-10-07
- 1.3.0 — 2017-10-05
- 1.2.0 — 2017-06-17
- 1.1.0 — 2017-02-20
- 1.0.0 — 2016-11-15

## README

# neutronium vue command mixin
<p align="center"><img width="100"src="https://raw.githubusercontent.com/David-Desmaisons/neutronium-vue/master/template/src/assets/logo.png"></p>
Mixin to integrate MVVM ICommand with vue

[![Npm version](https://img.shields.io/npm/v/neutronium-vue-command-mixin.svg?maxAge=2592000)](https://www.npmjs.com/package/neutronium-vue-command-mixin)
[![MIT License](https://img.shields.io/github/license/David-Desmaisons/neutronium-vue-command-mixin.svg)](https://github.com/David-Desmaisons/neutronium-vue-command-mixin/blob/master/LICENSE)
[![Npm version](https://img.shields.io/npm/v/neutronium-vue-command-mixin.svg?maxAge=2592000)](https://www.npmjs.com/package/neutronium-vue-command-mixin)

## Usage
Provide mixin to easily integrate ICommand in vue.js using Neutronium.
Component this mixin exposes:

## Props
### `command`
Type: `Object`<br>
Required: `true`<br>

The property corresponding to the C# command.

### `arg`
Type: `Object`<br>
Required: `false`

The argument that will be passed to comand when execute is called.

## Computed
### `canExecute`
Type: `Boolean`<br>

true if Command CanExecute is true.

## Method
### `execute`

Call the corresponding command with the argument `arg`

## Events
### `beforeExecute`

Called before calling command execute if CanExecute is true. 

The event argument provides two properties: 
* `arg`: `Object` the command argument, 
* `cancel`: `false` set it to true to cancel the execution

### `afterExecute`

Called after calling command execute. 

The event argument is the command argument. 

## Example
Declaring buttonCommand component in a .vue file (using semantic ui):
 
```javascript
<template>
  <div class="ui button" :class="{'disabled': !canExecute}" @click="execute">   
    <slot></slot>  
  </div>
</template>
<script>
import comandMixin from 'neutronium-vue-command-mixin'

export default {
  mixins:[comandMixin]
}
</script>

<style>
</style>
```

Using buttonCommand:

```javascript
<button-command :command="compute" :arg="argument">
	Submit
</button-command> 
```


## Install using npm:
```bash
npm install neutronium-vue-command-mixin --save
```

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