diff --git a/README.md b/README.md index 95c5116..12ef56f 100644 --- a/README.md +++ b/README.md @@ -77,13 +77,11 @@ From there you can use as normal. Here's an [example on JSBin](http://jsbin.com/ ## Parameters ```javascript /** - * Contains the currently selected value. Very similar to a - * `value` attribute on an . In most cases, you'll want - * to set this as a two-way binding, using :value.sync. However, - * this will not work with Vuex, in which case you'll need to use - * the onChange callback property. - * @type {Object||String||null} - */ + * Contains the currently selected value. Very similar to a + * `value` attribute on an . You can listen for changes + * using 'change' event using v-on + * @type {Object||String||null} + */ value: { default: null }, @@ -166,14 +164,6 @@ From there you can use as normal. Here's an [example on JSBin](http://jsbin.com/ default: 'label' }, - /** - * An optional callback function that is called each time the selected - * value(s) change. When integrating with Vuex, use this callback to trigger - * an action, rather than using :value.sync to retreive the selected value. - * @type {Function} - * @default {null} - */ - onChange: Function, /** * Enable/disable creating options from searchInput. diff --git a/docs/components/Examples.vue b/docs/components/Examples.vue index 48341fd..e9bc5a2 100644 --- a/docs/components/Examples.vue +++ b/docs/components/Examples.vue @@ -100,10 +100,10 @@
- +
-

vue-select provides an onChange property that accepts a callback function. This function is passed the currently selected value(s) as it's only parameter.

+

vue-select provides an change event. This function is passed the currently selected value(s) as it's only parameter.

This is very useful when integrating with Vuex, as it will allow your to trigger an action to update your vuex state object. Choose a callback and see it in action.

@@ -122,7 +122,7 @@
-
<v-select on-change="consoleCallback" :options="countries"></v-select>
+
<v-select v-on:change="consoleCallback" :options="countries"></v-select>
methods: {
   consoleCallback(val) {
     console.dir(JSON.stringify(val))
diff --git a/docs/components/Params.vue b/docs/components/Params.vue
index 9619826..c7ef210 100644
--- a/docs/components/Params.vue
+++ b/docs/components/Params.vue
@@ -2,15 +2,13 @@
   
   
props: {
 
-    /**
+   /**
      * Contains the currently selected value. Very similar to a
-     * `value` attribute on an &lt;input&gt;. In most cases, you'll want
-     * to set this as a two-way binding, using :value.sync. However,
-     * this will not work with Vuex, in which case you'll need to use
-     * the onChange callback property.
+     * `value` attribute on an . You can listen for changes
+     * using 'change' event using v-on			 
      * @type {Object||String||null}
      */
-    value: {
+   value: {
       default: null
     },
 
@@ -80,16 +78,8 @@
     label: {
       type: String,
       default: 'label'
-    },
-
-    /**
-     * An optional callback function that is called each time the selected
-     * value(s) change. When integrating with Vuex, use this callback to trigger
-     * an action, rather than using :value.sync to retreive the selected value.
-     * @type {Function}
-     * @default {null}
-     */
-    onChange: Function
+    }
+    
   }
     
diff --git a/src/components/Select.vue b/src/components/Select.vue index ef7b995..a684016 100644 --- a/src/components/Select.vue +++ b/src/components/Select.vue @@ -174,7 +174,7 @@