From 5ad0f70109a7cdde905a08988e6be188ab4de431 Mon Sep 17 00:00:00 2001 From: Luca Ban Date: Tue, 29 May 2018 18:31:03 +0900 Subject: [PATCH] add new guidance about registering just the directive --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 6d89762..efa009e 100644 --- a/README.md +++ b/README.md @@ -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' @@ -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