preface

Vue is a library for building interactive Web interfaces. Vue provides MVVM data binding and a composable component system with a simple, flexible API. React is a JAVASCRIPT library for building user interfaces. React is mainly used to build UIs. React has high performance, very simple code logic, and more and more people are paying attention to and using React.

Vue features:

  • Simplicity: HTML template + JSON data, and create a Vue instance.
  • Data-driven: Automatically tracks dependent template expressions and evaluates properties.
  • Componentization: Constructs interfaces from decoupled, reusable components.
  • Light weight: ~24kb min+gzip, no dependency.
  • Fast: Accurate and efficient asynchronous batch DOM updates.
  • Module-friendly: Seamlessly integrate into your workflow via NPM or Bower installation.

Summary of Vue interview questions

Vue – cli project

  • What technologies are involved in the VUE-CLI project, and what are their roles?
  • What are the common NPM commands used in vuE-CLI projects?
  • Name the use of folders and files in vue-CLI project
  • The index.js file in config folder is used to configure the engineering development environment and production environment
  • Please tell us more about the configuration in package.json

Vue core knowledge points

  • Understanding that Vue is a set of progressive frameworks
  • What are the two cores of vue.js?
  • What is the difference between V-IF and V-show
  • Vue is a common modifier
  • Can V-ON listen for multiple methods?
  • The function of the key value in vUE
  • Vue – CLI Project Upgrade vUE version
  • How are event objects used in VUE events?
  • The use of $nextTick
  • Why does data have to be a function in a Vue component
  • Priority of V-for and V-IF
  • The vUE neutron component calls the parent component’s method
  • The role of the keep-alive component in vUE
  • How to write reusable components in VUE?
  • What is the VUE lifecycle?
  • What are the VUE lifecycle hook functions?
  • How does VUE listen for keys in keyboard events?
  • Method that triggers view updates when vUE updates an array
  • Considerations for object change detection in VUE
  • Solve the initialization page flash problem of non-engineering projects
  • The list generated by V-for implements active switchover
  • Use in components of v-Model syntax sugar
  • Custom filters in vUE
  • Vue and other single-page applications and their advantages and disadvantages
  • What are the calculated properties of vUE?
  • Vue-cli provides several scaffolding templates
  • How does a VUE parent component pass data to its children?
  • How to disable the scroll bar after vue popup?
  • Calculate the difference between caching and method calls for attributes
  • Vue-use of custom commands in the CLI

vue-router

  • How does vue-Router respond to route parameter changes?
  • Complete vue-Router navigation parsing process
  • What kind of navigation hooks does vue-Router have?
  • Vue-router Transmits parameters in several ways
  • Vue-router dynamic route matching
  • How does vue-router define nested router routes?
  • Components and their properties
  • Vue-router Implements lazy route loading (dynamic route loading)
  • Vue-router Indicates the two modes of routing
  • History Route mode and background configuration

vuex

  • What is Vuex?
  • Use the core concepts of VUex
  • Vuex application in VUE-CLI
  • Using vuex in vUE, change the value of state
  • Vuex Actions Asynchronously changes the status

The HTTP request

  • What are Promise objects?
  • What is the difference between Axios, FETCH and Ajax?
  • What are the same origin policy and cross-domain issues of JS?
  • How to solve cross-domain problems?
  • What is axios about?

The UI style

  • .vue component’s scoped property
  • How do I make CSS work only in the current component?
  • Vue-ui component library commonly used in the CLI
  • How to adapt to mobile? “Classic”
  • Media query on the mobile terminal
  • Vue content is centered vertically and horizontally
  • Vue-cli method of introducing pictures
  • Common style problems on mobile
  • Text beyond hiding

Commonly used functions

  • How to implement TAB switching in VUE?
  • Keep-alive implements TAB component caching in Vue
  • Slide pages from right to left in VUE
  • How do parent and child components call methods to each other in VUE?
  • Use of the VUE central event bus

MVVM design pattern

  • MVC, MVP, and MVVM patterns
  • The difference between MVC, MVP and MVVM
  • The realization principle of MVVM
  • Object. DefineProperty () method
  • Classes and objects defined in ES6
  • Document fragments in JS
  • Deconstruction assignment
  • Array.from
  • Array.reduce
  • Use of recursion
  • Obj. Keys () and Obj. DefineProperty
  • Publish and subscribe
  • Vue project optimization, shorten the loading time of the first screen

Further develop

  • This section describes how to run the vue development command NPM run dev
  • Server-side rendering of VUE
  • Write an NPM installation package from zero
  • Vue-a loader commonly used in the CLI
  • The characteristics of the webpack

Limited space, interview materials are needed [Click here toReact framework interview questions (including questions and answers)

The React features:

  • Declarative design: React uses the declarative paradigm to easily describe applications.
  • Efficient: React minimizes interaction with the DOM by emulating the DOM.
  • Flexible: React works well with known libraries or frameworks.
  • JSX: JSX is an extension of JavaScript syntax. React development doesn’t necessarily use JSX, but we recommend it.
  • Components: React builds components to make code easier to reuse and can be used in large project development.
  • One-way response data flow: React implements one-way response data flow, which reduces repetitive code, which is why it’s simpler than traditional data binding.

React Interview questions

Basic knowledge of

  • Distinguish between Real DOM and Virtual DOM
  • What is React?
  • What’s special about React?
  • List some major advantages of React.
  • What are the restrictions on React?
  • What is JSX?
  • Do you know Virtual DOM? Explain how it works.
  • Why can’t browsers read JSX?
  • How is the React ES6 syntax different from ES5?
  • How is React different from Angular?

The React components

  • You understand the phrase “In React, everything is a component.”
  • Explain the purpose of render() in React.
  • How do I embed two or more components into a component?
  • What is the Props?
  • What’s the state in React? How is it used?
  • Distinguish between states and props
  • How do I update the state of a component?
  • What’s the arrow function in React? How does it work?
  • Distinguish between stateful and stateless components.
  • What are the phases of the React component lifecycle?
  • Explain the React component’s lifecycle methods in detail.
  • What are events in React?
  • How to create an event in React?
  • What are the composite events in React?
  • What do you know about React refs?
  • List some situations in which Refs should be used.
  • How to modularize code in React?
  • How do I create forms in React
  • How much do you know about controlled and uncontrolled components?
  • What is HOC?
  • What can you do with HOC?
  • What is a pure component?
  • What’s the importance of keys in React?

React Redux

  • What are the main problems with the MVC framework?
  • Explain Flux
  • What is a Redux?
  • What are the three principles Redux follows?
  • What do you mean by “single source of fact”?
  • List the components of Redux.
  • How does data flow through Redux?
  • How do I define actions in Redux?
  • Explain the role of Reducer.
  • What does Store mean in Redux?
  • How is Redux different from Flux?
  • What are the benefits of Redux?

The React routing

  • What is the React route?
  • React Router V4 uses the switch keyword.
  • Why routes in React?
  • List the advantages of the React Router.
  • How does a React Router differ from a regular route?