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

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

lowercase

lowercase Example: {{ msg | lowercase }} ‘ABC’ => ‘abc’

vm.$off()

vm.$off( [event, callback] ) Arguments: {String} [event] {Function} [callback] Usage: Remove event listener(s). If no arguments are provided, remove all event listeners; If only the event is provided, remove all listeners for that event; If both event and callback are given, remove the listener for that specific callback only.

elementDirectives

elementDirectives Type: Object Details: A hash of element directives to be made available to the Vue instance. See also: Element Directives Assets Naming Convention

directives

directives Type: Object Details: A hash of directives to be made available to the Vue instance. See also: Custom Directives Assets Naming Convention

currency

currency Arguments: {String} [symbol] - default: '$' 1.0.22+ {Number} [decimal places] - default: 2 Example: {{ amount | currency }} 12345 => $12,345.00 Use a different symbol: {{ amount | currency '£' }} 12345 => £12,345.00 Some currencies have 3 or 4 decimal places, while some others have none, for example Japanese Yen (¥) or Vietnamese Dong (₫): {{ amount | currency '₫' 0 }} 12345 => ₫12,345

beforeCompile

beforeCompile Type: Function Details: Called right before the compilation starts. See also: Lifecycle Diagram