Vue
, especially rain Brook
Progressive frame JAVAscript
MVVM frame
M: deletions layer data model change search
V: view similar to the view of layer the same HTML template
VM: viewModel model and a view of the mapping layer
Advantages:
The data driver View
Reflow and redraw the
layout page layout simple terms has changed is the reflow
simple terms the elements of a page layout style operation will not lead to a change in redrawing
Reflux will occur redraw
redraw necessarily reflux occurs
frequently used instructions VUE
V-text {{}}
V-HTML
V the bind-:
V @ ON-.stop .prev .enter .keyCode Event value $
V-form Model form .number
Object.defineProperty
the Proxy
V-for
Show-v
v-IF
difference:
Run the display properties of the former operating elements of the initial rendering of the large overhead
of creating and destroying the latter operating elements of the larger overhead
Usage scenarios:
V-IF the else-
V the else-
V pre-
V-Cloak
V-Once
V-slot socket
Custom instruction
registered globally
Vue.directive ()
locally registered
VUE ({
})
Filter
Vue.filter ()
assembly
Vue.component ()
watch
attribute listener
based on the dependence Vue, when dependent property has changed, then it will automatically trigger corresponding method for data processing
If the listener object is referenced only when listening to whether or address changes specific value We not listen
, if the object needs to listen to changes in the value of a function handler deep: true
not monitor changes this.arr data (special case) is [0] = 200; this.arr.length = 0
will be received in the listening function in 2 to a new value and the value of an old value
$ SET () responsive to a response corresponding to a formula attribute is added
Features:
a data affect multiple data
computed
attribute is calculated
based on the dependence Vue, when dependent property has changed, then the method will automatically trigger data corresponding to the processing
data buffer
It features
a data affected by multiple data
Lifecycle
beforeCreate
the Created
beforeMount
Mounted
beforeUpdate
Updated
beforeDestroy
Destroyed
activated active state
deactivated state cache
Dynamic component
changes dynamically switch assembly through the same mount point
<component> </ coponent> is
<keep-alive></keep-alive> (***)
属性:
include
exclude
max
Vue animation
current element must follow two characteristics
1, must go through the show hidden
2, the outer animation elements need to be performed must add a <tranisition> </ tranisition>
name: the name of the animation
name-enter
name-enter-active
name-enter-to
name-leave
name-leave-active
name-leave-to
<tranisition
enter-class
enter-active-class
enter-to-class
。。。
></tranisition>
Component values pass
from father to son
custom properties
The props: [] {}
type default required
Parent child transmission
triggered by this custom method. $ Emit
Through the slot Scope
Non Sons
public vue instance of an object
EventBus
manual package $ on $ emit $ off event subscription
Vuex
In order to make the assembly more flexible
Why data rather than an object in the assembly is a function?
What is the single data stream?
Slot
slot
The default name is default
If the time required command v-slot: name
Scope slot:
V-slot: name = "value of the received"
<Banner>
<Template V-slot>
<P> 111 </ P>
</ Template>
</ Banner>
vue instance body approach
$ Mount ()
$ the destroy ()
$ foreUpdate
$on
$emit
$off
$once
1, what is redraw reflux and
2, the virtual DOM (DOM virtual objects is the real JS, JS objects in memory operation is faster than the speed of operation of real DOM)
3, modular
4, key value What is the role of virtual DOM
5, Object.defineProperty
6, advantages and disadvantages of single-page development and the development of multi-page
Blog
-depth responsive principle
Single-file assemblies?
Leak filled
<keep-alive> </ keep -alive>
Examples of the method body
$ Extend
$ a mixin
routing
Vuex
Axios
cross-domain
movement end