Content provider: Jinniu District Wudi Software Development Studio
Most of my friends in my fan base are looking for jobs in VUE instead of react, so THE HTML, CSS, JS and React interview questions I summarized before are not enough, and I still need to continue to expand vUE. So I put the vUE interview questions that we met when we went out to interview to collect the way that fans contributed to make a summary, hoping to help more friends ~
Vue interview question text:
1. What does vue family bucket contain?
Answer: Vue family buckets vs. React family buckets
2. What is v-Model? How to use it? How do tags bind events in VUE?
Answer: V-model can implement bidirectional binding, instructions (V-bind :class, V-for, V-if, V-show, V-ON). Vue’s Model layer data property. <input @click=doLog()/>
3. The realization principle of V-Model?
Answer: VUE data bidirectional binding implementation principle analysis
4. Tell me about the vUE life cycle.
Answer: VUE lifecycle details
5. Name at least four vUE commands and their usage.
Answer: V-if: judge whether to hide; V-for: data loop out; V-bind :class: to bind a property; V-model: implements bidirectional binding. (See vUE official website for other information)
6. Tell the difference between V-if and V-show.
Answer: The difference between V-if and V-show and their application scenarios are introduced in detail
7. Which component is an active-class property?
Answer: Router-link component of vue-Router module.
8. What is the definition of vUE nested routine?
Answer: VUE define nested routines explained by detailed steps (attached code)
9. How to define a vue-router dynamic route? How to get the passed dynamic parameters?
Answer: Add /:id to the path attribute in the index.js file in the router directory. Get the parameters using params.id of the Router object.
10. What kinds of navigation hooks does vue-Router have?
BeforeEach (to,from,next), intercepts before jumping. Second: hooks within components. Third: separate route exclusive component.
11. Pros and cons of iframe?
An iframe is also called an embedded framework. An embedded framework is similar to a framed web page in that it can embed the frame and content of a web page into an existing web page. Advantages:
- Solve loading problems for slow loading third-party content such as ICONS and ads
- Security sandbox
- Parallel loading script
- Easy to make navigation bar
Disadvantages:
- Iframe blocks the Onload event on the main page
- Even if the content is empty, it takes time to load
- There is no meaning
12. Tell me about your use of Axios or other requests.
Answer: Use of AXIos in vue projects
13. What happens when you call axios. Post (‘ API /user ‘) in axios+tp5? Axios. Put (” API/user / 8 ‘)?
Answer: Cross domain, add user operation, update operation.
14. What is vuex? How to use it? Which functional scenarios use it?
Answer: State management in the VUE framework. Import store and inject in main.js. Create a new directory store… . Export. The scenarios are as follows: Status between components in a single-page application. Music play, login status, add shopping cart.
15. What is the MVVM framework? What distinguishes it from other frameworks (jquery)? Which scenarios fit?
Answer: A model+ View +viewModel framework, data model model, viewModel connect two
Difference: VUE is data-driven, showing the view layer through data rather than node operations.
Scenario: A scenario in which many data operations are performed
16. What are the methods of custom instruction (V-check, V-focus)? What hook functions does it have? What other hook function arguments are there?
Directive: The directive method of a Vue object takes two arguments, the directive name and the function. Component defines directives: directives
Inserted hook functions: Bind (triggered by a bind event), Update (triggered when a node is inserted), update (associated updates within the component)
Hook function parameters: EL, binding
17. What is vue-router? What components does it have?
Answer: A plug-in for vue to write routes. The router – the link, the router – the view
18. What are the navigation hooks? What parameters do they take?
A: Navigation hooks include: A/global hooks and proprietary hooks within components. B /beforeRouteEnter, afterEnter, beforeRouterUpdate, beforeRouteLeave
Arguments: to (the route to), from (the route to leave), next (be sure to use this function to get to the next route, if not, intercept) the most common ones.
19. What is the process of vUE component encapsulation?
Answer: First of all, components can improve the development efficiency of the whole project. Abstract the page into several relatively independent modules, solve our traditional project development: low efficiency, difficult to maintain, reuse and other problems.
Create a component and then register the component using the Vue.component method. Subcomponents need data, which can be defined in props. The emit method can be used by the child component to send the modified data to the parent component.
20. How do you know Vuex?
Answer: VUEX can be understood as a development pattern or framework. PHP has ThinkPHP, Java has Spring, etc. Changes to driver components are centrally managed through state (data sources) (just as Spring’s IOC container centrally manages beans).
Application-level state is centralized in the Store; The way to change that is to submit mutations, which is a simultaneous thing; Asynchronous logic should be encapsulated in actions.
21. What is vue-loader? What are the uses for it?
A loader that parses.vue files and converts them into JS modules with template/js/style.
Use: JS can write ES6, style style can SCSS or less, template can add Jade, etc
22. What is the use of each folder and file in the SRC directory in vue.cli project?
Answer: The assets folder contains static resources. Components; Router defines routing configurations. View; App. vue is an application main component; Main.js is the entry file
23. What do you understand about template compilation in vue.js? The render function returns VNode (Vue’s virtual DOM node).
24. How to use custom components in vue.cli? Have you encountered any problems?
Step 1: Create a new component file (smithbutton.vue) in the Components directory. Script must export default to export the component.
Step 2: Import smithButton from ‘.. / components/smithButton. Vue ‘
Step 3: Inject into the components property of the vue child component,components:{smithButton}
Step 4: Use it in the template view, the problem is: smithButton name, use smith-button.
25. In what life cycle is dom rendered?
Answer: In Mounted
26. Which life cycles are triggered by the first page load?
Answer: beforeCreate, Created, beforeMount, and Mounted are triggered the first time the page is loaded.
27. What is the role of the VUE lifecycle?
Answer: It has multiple event hooks throughout its lifecycle, making it easier to form good logic when controlling the process of the entire Vue instance.
28. How to solve the problem that vue does not refresh the page when modifying data? $this.$set (); $this.$forceUpdate ()
29. Why does the page not refresh after vue modifies data? Answer: Restricted by ES5, vue.js cannot detect additions or deletions of object attributes. Because vue.js converts a property to a getter/setter when initializing an instance, the property must be on the data object for vue.js to transform it in order for it to be responsive.
30. What are the important new features of Vue3.0? The answer:
31. What are the advantages of Vue3.0 over Vue2.0? The answer:
32. What are the differences and similarities between Vue3.0 and React 16.x? The answer:
33. How does Vue3.0 achieve code logic reuse? The answer:
34.
Interview questions continue to update, welcome friends actively contribute ~ together to share good things to more friends. Contributors please comment on your QQ or Wechat below, I add you.