View on GitHub

wiki

Vue

General

State

Don’t set state properties. Mutate them.

Only use:

Vue component properties

Props

Used to pass around “arguments” between components.

# Just use `var` for static props
<ChildComponent message='hey' />

# Prepend with a colon for dynamic props (i.e., variables)
<ChildComponent :sets=sets />

Methods

Component-local functions.

Computed

Can be referenced by the template. Computed properties are cached based on their dependencie, but only on ‘reactive dependencies’.

computed: {
    someComputedValue () {
        return `hello world ${name}`
    }
}