Giter VIP home page Giter VIP logo

fe-interview-questions-collect's Introduction

Hi

I am an Web Front-end Developer from China.

huaTJ0210

fe-interview-questions-collect's People

Contributors

huatj0210 avatar

Watchers

 avatar

fe-interview-questions-collect's Issues

Vue:请对vue与react做一下比较?

1、相同点:

  • 使用了虚拟DOM,在复杂的DOM结构操作时能提高性能;
  • 提供了组件化的视图组件
  • 核心库只专注于视图层,其他路由、状态管理均由其他库实现
  • 原生渲染方面提供了RN、weex之类的框架可供选择

2、不同点

  • 响应式渲染实现机制
  • HTML:JSX与template的区别
  • CSS:实现模块化的区别
  • 构建工具的配置方面区别
  • 上手的难易程度
  • React Hooks vs 组合API

vue与其他框架的比较

Vue:VueRouter的基本原理解析

router.push('xxx')为主线,描述路由导航的过程

1、基本过程

  • router.push(path) 会触发底层history库(VueRouter底部依赖库)的transitionTo方法
  • transitionTo方法中:
    1、根据path获取到要更新的路由信息route(主要是通过path去路由配置表中去匹配);
    2:触发history的callback函数cb(route)
    3、调用修改导航栏地址的方法;
  • cb(该函数在browser和hash中被注册)被调用接收最新的route,然后更新响应式的_route(绑定在全局vue实例上app._vue);进而引发组件的重新渲染

2、根Vue实例上存在一个响应式的_vue属性,何时被挂载的?

  • 在VueRouter的install方法中会触发Vue.mixin的beforeCreate方法;
  • 此方法中会在Vue根实例上挂载一个响应式属性_vue;然后调用Router的init方法,将根实例传入到Router中(这样history.cb方法内部就能更新_route);
  • _route变化就会通知watcher(属于根实例)进而进行组件的整体渲染;
  • 在整体渲染中router-view组件根据匹配到的组件调用render函数进行渲染;

javascript!! Promise相关面试题汇总

需要了解Promise的知识点:

  • 是什么
  • 解决了哪些问题? 如何解决的?
  • Promise的核心实现[源码实现、all、catch、finally、race、settled]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.