Understanding Vue 3's "expose"

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

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

  • @VueMastery
    @VueMastery  2 года назад +7

    ⚡ You can access the written tutorial for free here: buff.ly/3JP0jI7

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

    Not gona lie, the last part flew over my head. Never seen render function used.

    • @alwaisy
      @alwaisy Год назад

      same bro. but render h function mostly used in functional components in vue

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

    When you are making an opensource lib, why would you want that method to be private? Why not allow the users to call whatever method they want, just a questions if somebody can answer

    • @underscoreseanohue
      @underscoreseanohue 2 года назад +5

      You might want to have the method be used internally by the component, and especially if the component is still being developed, the API might change (for example changing the parameters or return-value).
      If an end-user builds their app to rely on an internally-used method which then breaks because it should have been private, there is a problem).

    • @justafreak15able
      @justafreak15able 2 года назад +4

      Exposing everything and calling it a day isn't always a good idea.

  • @rsoaresmga
    @rsoaresmga Год назад +1

    Perfect! 👏

  • @CZiNTrPT
    @CZiNTrPT 2 года назад +1

    So how do I expose every method with `h()` without writing all of them out explicitly in `context.expose(..)`

  • @jocabin1518
    @jocabin1518 2 года назад +1

    What theme do you use ?

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

    Very good video. Do you know if using "expose" allows the private methods to be minified/uglified by the bundler?

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

    Hi! Great tutorial thanks, I have a question related to syntaxes, how can I access expose in that case?

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

    thank you very much, very useful explanation ✨

  • @Sun0fABeach
    @Sun0fABeach 2 года назад +2

    I would have preferred if she stressed that calling child methods by the parent is a huge antipattern. Never do this, unless can't think of an idiomatic way to do it otherwise, because it breaks the props down / events up contract between parent / child. I'd love the child methods to be private by default, only being explicitly exposable, but that would break backward compatibility.

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

    Neat! Thanks.

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

    Thanks you

  • @phojie6868
    @phojie6868 Год назад

    Why not use store instead, this practice makes the code not easy to read in the future

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

    Hi Hermiona

    • @MrCC-hx8xr
      @MrCC-hx8xr Год назад

      Hermiona & Vue master = awesome combination ;-)

  • @matmister1769
    @matmister1769 2 года назад +8

    emma watson?

  • @ackar82
    @ackar82 2 года назад +1

    slowly vue just looks bloated and bad designed