Preface: front-end interview in March 2019 carried out, probably interviewed have about 8, for their interview knowledge, after the end of the interview were carried out, and then write a memo mobile phones, have the opportunity to conduct some tutoring, lessons may not very comprehensive, hope forgive me
this point, always point to a target
if the direct function and then call the parent is the window
new new can change this point,
anyone who calls on the point
Life Cycle is called only once, each time you enter a new page will be executed once, leaving destruction.
async and defer the difference
Asynchronous (async) script will be executed immediately after the completion of its load, and delay (defer) script will wait after HTML parsing is complete, press the load order of execution.
new operator
Create an empty object, and this variable refers to the object, but also inherited the function prototype
Properties and methods are added to the object referenced by this
The newly created object referenced by this, and finally return to this implicit
// add remove inserted in place
appendChild()
removeChild()
replaceChild()
insertBefore()
Object oriented
polymorphism, encapsulation, inheritance
appreciated vuex the
store
Four properties core library of
state
to store data which can be placed in any type of data
this. $ Store.state. Attribute name to get
getters get state inside the store any data can return state. attribute names get to
be mapGetters ([defined name]) acquired
mapGetters need to import introduced in the page
gives an operation told mutation to modify the state which data actions
can make conditional, asynchronous operation (setTimeout, setInterval), ajax request, triggering event, such action but only issue dispatch actions, submitted to mutation by the commit, and does not modify any data, parameters have extra payload can be transmitted by way of
mutation data modifications, actions data submitted over here to modify, and then submitted to the state, render, page rendering is complete, carry out their duties.
Vuex data is usually completed listen computed inside.
Adapted to communicate data between the general-purpose large-scale projects coexisting components.
Object-oriented
key js is single-threaded, asynchronous browser is the
most rely on the callback function.
replace
the historical returns recorded before the replacement
push
after the jump, return key has returned history
Lifecycle
page and loading data.
Initialization, data el
data
prototype prototype chain array array.ptototype
Copy with the push of the array concat with
the prototype, the prototype object, the prototype chain is valid
Usage promise
callback
after the execution of the function and then execute
the line next function
Cross-domain, different protocols, domain name, port
axios cross-domain
index.js configuration proxytable
Way cross-domain
JSONP
coxrs
http and https protocol count different cross-domain computer
axios simultaneously request a plurality of interfaces
(axios.all [1 interfaces, the interface 2])
Vertical center css3
Closure
img Road King converted to base64 benefits (base64 turn can set your own size, it is generally recommended 10kb)
css3 painted semicircle
New css3 animation, rotation,
The new label html5 video article section nav header
vue way binding principles
event listener, set get property methods
vue listening watch event listener
mounted hook function
computed to calculate property
# Route add with without distinction (hash with history)
axios principle with ajax difference
axios ajax upgrade package is better
ajax can not cross-domain.
data datatype url async
Page optimization
cdn-party plug-ins introduced cache
img, css, js compression
code structure to optimize reuse
webpack packaged / multi-page application
can be re-compressed position plus the corresponding compression page name, location also need to add other compression
Communication between peer vuex
or middleware event.bus
Father and son props, child-parent communication $ emit $ on
v-show with v-if the difference
Custom command
es6
- Applets
vue bubbling == @ click = stop
cancel the default event == href.prevent
to a space == v-model.trim
Copy of the array (a first copy of the second array, the second array if the change, the first change it will
be.)
http with https difference
http is not very secure basic TCP transmitted in the clear.
https encryption based on security certificates tls / ssl transmission
tls and ssl is something similar to
the application layer and the data is first spread to tls ssl, encryption and then spread inside the transmission tcp
ssl encryption suite is an upgraded version of ssl tls is now basically use tls encryption kit sub symmetry encryption, CA certificate