search

Home  >  Q&A  >  body text

javascript - In vue.js2.0, are the hook functions between components independent of each other? Or are they all hooks of the shared new vue() instance?

In the process of learning vue.js, hook functions are used when developing components, but some of them are not very clear
If both component A and component B perform operations in the created hook function, I think I’m asking whether the created hooks in component A and component B are independent of each other, or whether they all use the same certified hook instantiated in the top-level new vue(). I don’t know if I expressed it clearly...

仅有的幸福仅有的幸福2756 days ago830

reply all(2)I'll reply

  • 天蓬老师

    天蓬老师2017-05-16 13:13:47

    Of course they are independent.

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-16 13:13:47

    Vue components are independent of each other. If you understand the life cycle of a Vue instance, it will be clear at a glance, or you can write a Demo and print the results. In addition, you can take a look at the usage of Mixin

    reply
    0
  • Cancelreply