Upgrade to Kdu v3

API

Global Config

Kdu.config is an object containing Kdu’s global configurations. You can modify its properties listed below before bootstrapping your application:

silent

optionMergeStrategies

devtools

errorHandler

warnHandler

ignoredElements

keyCodes

performance

productionTip

Global API

Kdu.extend( options )

Kdu.nextTick( [callback, context] )

Kdu.set( target, propertyName/index, value )

Kdu.delete( target, propertyName/index )

Kdu.directive( id, [definition] )

Kdu.filter( id, [definition] )

Kdu.component( id, [definition] )

Kdu.use( plugin )

Kdu.mixin( mixin )

Kdu.compile( template )

Kdu.observable( object )

Kdu.version

Options / Data

data

props

propsData

computed

methods

watch

Options / DOM

el

template

render

renderError

New in 2.2.0+

Options / Lifecycle Hooks

All lifecycle hooks automatically have their this context bound to the instance, so that you can access data, computed properties, and methods. This means you should not use an arrow function to define a lifecycle method (e.g. created: () => this.fetchTodos()). The reason is arrow functions bind the parent context, so this will not be the Kdu instance as you expect and this.fetchTodos will be undefined.

beforeCreate

created

beforeMount

mounted

beforeUpdate

updated

activated

deactivated

beforeDestroy

destroyed

errorCaptured

New in 2.5.0+

Options / Assets

directives

filters

components

Options / Composition

parent

mixins

extends

provide / inject

Options / Misc

name

delimiters

functional

model

New in 2.2.0

inheritAttrs

comments

Instance Properties

vm.$data

vm.$props

New in 2.2.0+

vm.$el

vm.$options

vm.$parent

vm.$root

vm.$children

vm.$slots

vm.$scopedSlots

vm.$refs

vm.$isServer

vm.$attrs

vm.$listeners

Instance Methods / Data

vm.$watch( expOrFn, callback, [options] )

Note: when mutating (rather than replacing) an Object or an Array, the old value will be the same as new value because they reference the same Object/Array. Kdu doesn’t keep a copy of the pre-mutate value.

vm.$set( target, propertyName/index, value )

vm.$delete( target, propertyName/index )

Instance Methods / Events

vm.$on( event, callback )

vm.$once( event, callback )

vm.$off( [event, callback] )

vm.$emit( eventName, […args] )

Instance Methods / Lifecycle

vm.$mount( [elementOrSelector] )

vm.$forceUpdate()

vm.$nextTick( [callback] )

vm.$destroy()

Directives

k-text

k-html

k-show

k-if

k-else

k-else-if

k-for

k-on

k-bind

k-model

k-slot

k-pre

k-cloak

k-once

Special Attributes

key

ref

is

slot deprecated

Prefer k-slot in 2.6.0+.

slot-scope deprecated

Prefer k-slot in 2.6.0+.

scope removed

Replaced by slot-scope in 2.5.0+. Prefer k-slot in 2.6.0+.

Used to denote a <template> element as a scoped slot.

Built-In Components

component

transition

transition-group

keep-alive

slot