Vue 3 Reactive vs Ref

Поделиться
HTML-код
  • Опубликовано: 5 ноя 2024

Комментарии • 19

  • @lukasluftlaufer1093
    @lukasluftlaufer1093 3 года назад

    Jetzt hat es endlich auch mal klick gemacht, was dieses ref() in der composition api ist. Danke Mario und Grüße aus Leipzig :)

  • @rafapioli75
    @rafapioli75 4 года назад +3

    Great explanation! Short and direct to the point. Thanks Mario!

    • @Webnoob
      @Webnoob  4 года назад

      Big thanks for your feedback 🙏💚

  • @maskman4821
    @maskman4821 4 года назад +1

    This is a very good example about ref and reactive, now I underdstand the differences, thank you mario for the explanations !!!

    • @Webnoob
      @Webnoob  4 года назад +1

      My pleasure, thank you 🙏💚

  • @jeffrey8483
    @jeffrey8483 4 года назад +9

    2:30 Of course it didn't work, you tried to re-assign a constant ;)

    • @Webnoob
      @Webnoob  4 года назад +5

      Uff, my mistake. You're right, but that doesn't change anything in the end. Vue cannot detect changes and can’t update the DOM even if we use var or let on a variable.
      We have to use Ref or Reactive 🤷‍♂️

  • @_elguet5787
    @_elguet5787 3 года назад

    thanks, short and precise

  • @МихаилПетровичЗубенко-р9в

    This video and that one were realy useful for me. Thanks!

    • @Webnoob
      @Webnoob  3 года назад +1

      Thanks for your feedback. Happy Coding!

  • @dasten123
    @dasten123 2 года назад

    7:06 but you can also put an object inside ref(), so your argumentation kind of falls flat.
    As far as I can tell, the only downside is that you have to write `.value` every time you want to access a property of it.
    Well, in my opinion it's not that bad, because since we have to do that with primitive types anyway, it at least is consistent.

  • @MarkKevinBesingaWebDev
    @MarkKevinBesingaWebDev 3 года назад

    great video really help me clear thing about ref and reactive.

  • @kobekobz5238
    @kobekobz5238 4 года назад +1

    Can i import this as a global, or its a nice practice just import it on every components, Thank you!

    • @Webnoob
      @Webnoob  4 года назад

      You can use the Composition API on every component and as composable functions. That’s perfect for reusability. 🙂

  • @cmlaplatacommunitymanagerl1929
    @cmlaplatacommunitymanagerl1929 3 года назад +1

    Hello! I love your videos. I try to use REF like an object and is working. If i understand fine you say that REF can't be an object, and is working for me. Just commment :)
    I'm from Argentina and sometimes i don't understand well some words.
    Thanks for the video!! I lear how to use reactive

    • @Webnoob
      @Webnoob  3 года назад

      Well, you could use ref() for creating a reactive object, but under the hood, it's just calling reactive() so you can also directly use reactive(). Thanks for your feedback ;-)

  • @hago7568
    @hago7568 3 года назад +2

    10 Euro wette du kommst aus Sachsen wie ich :D Danke fuer das video

    • @Webnoob
      @Webnoob  3 года назад

      Korrekt! ;-)

  • @abdi_pie7266
    @abdi_pie7266 3 года назад +2

    Where r u from dude? what happen with ur accent