Github is a daily summary of what you and your friends do together

Come on

We always hear about looking at the present in five years’ time, but I would say look at yourself in five years’ time (please don’t stop and be the person you want to be). Plan for 2 years and then plan gradually. Don’t complain, reflect on yourself, don’t complain (even complaining is futile, you can’t change others, you can only change yourself). Keep learning (even in stages) (as long as you keep learning). I don’t like people to say that gold will shine, gold shine also need a medium. So don’t rush, don’t rush, don’t rush. As long as the foot does not stop, then the end point is certainly a little farther than others, (for some people the right nonsense is nonsense, but for others I think it is necessary to say)

Learn to account

If you know 100 knowledge points, then if you calculate 100 knowledge points in terms of 10 years revenue, you can increase the price of 100 knowledge points by 5K. Then the price of each knowledge point is 5k1012/100, and the revenue of each question is 6K. Oh, my god, it doesn’t feel very profitable.

The interview

How can a vue watch answer a question with a computed answer get you a score of 90? (Usually the answer is “know it”, know why, can get high marks)

1 is a cache, but why is it supported and how is it implemented? 2.Com puted cannot be asynchronous, but Watch can be asynchronous. Why? (This is also because, actually, computed caches values.)

Computed is essentially a new watch but it has a lazy property

Computed only changes with watch.update, dirty is true

Watch performs an asynchronous render by adding the current this to the queue

Only when dirty is true will the current watch fetch a new value, otherwise the previous value will be used, and when called dirty will be false

So what do you say, first of all, about the difference between watch and computed one can’t be cached and one can be cached and one can be asynchronous and one can’t be asynchronous so if people don’t ask why they can be cached, I think you can say that it works because currently computed has a lazy true attribute, and then through the lazy attribute you assign dirty to a cache through dirty, whereas in the watch update lazy is true just does the current dirty is true, So it can’t be asynchronous, but watch does a queue, and the queue does an asynchronous rendering through nextTick. I think this answer can get high scores, know why, just say (one can’t cache one can cache, one can async one can’t async) like the back questions, certainly can’t get high scores.

The most common question is how does VUE work? So what does that implementation do? What does update do? Dependency collection? What I usually do is draw a picture and what I do with observe’s compiler. Several important points (1). Issue subscription, 2. Queue, 3. Asynchronous rendering), as the front end of the industry and training classes more and more, leading to less monk meat, so a few years ago good job, to now ask the principle of source code, life is not easy, so we work hard

So is your vUE principle what would you say?

What does New Vue do? Process? What the source code does is it initializes a bunch of data to vue’s prototype such as init and _init to vue’s prototype. Init set delete delete delete watch On and on and on, emit, _update forceUpdate, forceUpdate, forceUpdate, destroy, nextTick, nextTick, nextTick, render a bunch of apis, such as Parent, parent, parent, root, childre, childre, Childre, refs, slots, slots, slots, createElement and so on and then we do beforeCreate life cycle, initialize data, create life cycle, So we can get data in Created, BeforeMount life cycle updateComponent page render => _render function is executed VDOM Mounted Life cycle

Answer can be concise, hope can understand

$mount

_init

At the end

Don’t like do not spray