Giter Club home page Giter Club logo

Comments (2)

proc07 avatar proc07 commented on June 14, 2024 1

你同步更新 a b 两个属性,那么这两个会触发 Dep 对象中Watcher 的依赖派发,也就是 dep.notify() 去通知 watcher 进行update,update 会将 render watcher 添加到一个 queueWatcher 队列当中,那当前是触发了2次 update, 但是只会添加一次 render watcher 到队列当中,因为vue进行过滤了。然后在 nextTick 后执行队列,所以更新只会触发 一次渲染。 @alibabawanted

from vue-design.

hhuuuuuu avatar hhuuuuuu commented on June 14, 2024

@alibabawanted 首先我觉得好像没有同步队列这个概念。如果使用同步的方式去更新,肯定是先执行a的render watcher。然后才会执行this.b = '更新二',之后就会执行b的render watcher。还有就是渲染是发生在宏任务之前吧。

from vue-design.

Related Issues (20)

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.