vm.$interpolate()

vm.$interpolate( templateString ) Arguments: {String} templateString Usage: Evaluate a piece of template string containing mustache interpolations. Note that this method simply performs string interpolation; attribute directives are ignored. Example: // assuming vm.msg = 'hello' vm.$interpolate('{{msg}} world!') // -> 'hello world!'

Vue.filter()

Vue.filter( id, [definition] ) Arguments: {String} id {Function | Object} [definition] Usage: Register or retrieve a global filter. // register Vue.filter('my-filter', function (value) { // return processed value }) // two way filter Vue.filter('my-filter', { read: function () {}, write: function () {} }) // getter, return the filter if registered var myFilter = Vue.filter('my-filter') See also: Custom Filter

vm.$on()

vm.$on( event, callback ) Arguments: {String} event {Function} callback Usage: Listen for a custom event on the current vm. Events can be triggered by vm.$emit, vm.$dispatch or vm.$broadcast. The callback will receive all the additional arguments passed into these event-triggering methods. Example: vm.$on('test', function (msg) { console.log(msg) }) vm.$emit('test', 'hi') // -> "hi"

vm.$appendTo()

vm.$appendTo( elementOrSelector, [callback] ) Arguments: {Element | String} elementOrSelector {Function} [callback] Returns: vm - the instance itself Usage: Append the Vue instance’s DOM element or fragment to target element. The target can be either an element or a querySelector string. This method will trigger transitions if present. The callback is fired after the transition has completed (or immediately if no transition has been triggered).

vm.$root

vm.$root Type: Vue instance Read only Details: The root Vue instance of the current component tree. If the current instance has no parents this value will be itself.

vm.$once()

vm.$once( event, callback ) Arguments: {String} event {Function} callback Usage: Listen for a custom event, but only once. The listener will be removed once it triggers for the first time.

Custom Directives

Basics In addition to the default set of directives shipped in core, Vue.js also allows you to register custom directives. Custom directives provide a mechanism for mapping data changes to arbitrary DOM behavior. You can register a global custom directive with the Vue.directive(id, definition) method, passing in a directive id followed by a definition object. You can also register a local custom directive by including it in a component’s directives option. Hook Functions A definition object c

v-show

v-show Expects: * Usage: Toggle’s the element’s display CSS property based on the truthy-ness of the expression value. Triggers transitions if present. See also: Conditional Rendering - v-show

beforeDestroy

beforeDestroy Type: Function Details: Called right before a Vue instance is destroyed. At this stage the instance is still fully functional. See also: Lifecycle Diagram

json

json Arguments: {Number} [indent] - default: 2 Usage: Output the result of calling JSON.stringify() on the value instead of outputting the toString() value (e.g. [object Object]). Example: Print an object with 4-space indent: <pre>{{ nestedObject | json 4 }}</pre>