Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new guidance about registering just the directive #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ For other types of mask, use [vue-the-mask](https://vuejs-tips.github.io/vue-the

### A. Globally

Register component and directive globally:

```js
import Vue from 'vue'
import money from 'v-money'
Expand All @@ -25,6 +27,16 @@ import money from 'v-money'
Vue.use(money, {precision: 4})
```

Register only directive globally:

```js
import Vue from 'vue'
import { VMoney } from 'v-money'

// register only directive v-money
Vue.directive('money', VMoney)
```

### B. Use as component: https://jsfiddle.net/auom8st8/

```html
Expand Down