Today we met on two sides, the first one is an outsourcing company, mainly vUE and small program, the second one has no technical content, can write website, but WAS rejected by me, below are some interview questions I remember
1. Vue lifecycle functions
The VUE life cycle consists of four phases: 1. Instance creation 2. DOM rendering 3. 1. BeforeCreat — Trigger behavior before creation: the mount element $EL and the data object data of the vue instance are both undefined and uninitialized. Loading event 2:created — created action: Loading event 2:created — Created action: Created BeforeMount Behavior triggered before rendering: Vue instance el and data are initialized, but are still virtual DOM nodes, data.filter is not replaced. Vue instance mount complete, data.filter successfully render what can be done at this stage: use with routing hooks 5: beforeUpdate behavior triggered beforeUpdate: data triggered when update 6: updated behavior triggered after update: Trigger what you can do at this stage when data is updated: Do some processing when data is updated (watch can also be used to observe) 7: beforeDestroy Actions triggered before destruction: Trigger what you can do at this stage when components are destroyed: Ask the user whether to destroy 8: Destroy Post-destruction behavior: When the component is destroyed, the Vue instance unlistens for the event and is unbound to the DOM (no response), but the DOM node still does what it can do at this stage: prompt when the component is destroyed
2. Cross-domain and solutions
When any one of the protocol, domain name and port of a request URL is different from the current page URL, it is a cross-domain solution: 1. Jsonp 2. Window.postmessage () 4, set document.domain to solve the problem of cookies that cannot read non-homologous web pages. Cross-domain solutions
3. What have you encapsulated
This before did not notice, after coming back to find a few ready to practice a package SELECT:
Element-UI secondary encapsulation implements TreeSelect tree drop-down selection component encapsulation Axios encapsulation timer encapsulation date format encapsulation
4. What is Axios and how is it implemented
Axios is an HTTP client based on promises for browsers and NodeJS. The simple understanding is that ajax encapsulation is used in the project by installing the AXIos dependency package using vue-CLI, and then configuring itself to encapsulate HTTP in vue.config.js. Cli project encapsulates the global AXIOS, encapsulates the request, encapsulates the common API, and calls the whole process of the request
5, small program scan code, share circle of friends, customer service function
Small programs are using wechat’s native interface: scanCode: wx.scanCode. After the data is obtained, the failed or successful callback function is dropped to the interface wechat applet scanning function. Share wechat circle of friends: wx.onShowAppMessage and wx.onShowTimeLine wechat applet implementation is shared to the circle of friends
6, JQ
Leave it here and come back tonight to review the jQuery interview questions
7, promise
Promise is a solution for asynchronous programming. It is actually a constructor with all, Reject, and resolve methods on its own, and then, catch and other methods on its prototype with three states: Async awite can be used to simplify the promise pending, fulfilled and Rejected
8. Differences between Vue2.0 and 3.0
1. Project directory structure 2. Configuration item 3. Rendering mode 4. Supports TS Uses Vue3.0 New features and uses the difference between Vue2.0 and Vue3.0
What are the new features of ES7 and ES8
Es7:1, array.prototype. includes(value[, fromIndex]) 2, ideation operator () 3, strict mode changes in function scope Async Functions ES5 ES6 ES7 Es8 is a new feature
10, Canvas drawing will not
It is enough to learn the article of HTML5 Canvas
11. Have you ever used a template engine
Template: Analysis of embedded JS template engine EJS