Build a Reusable Modal Component Using Vue 3, The Composition API & Slots

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

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

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

    Yesterday, I was thinking where is my favorite RUclipsr why he is not uploading new video and here it is
    Thank you man

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

    You saved my day...there's nothing more beautiful than doing for yourself what you would have otherwise done with plugin. This way I caneasily adapt it to my project. Thanks a ton

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

      That’s awesome, glad to hear this was helpful!

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

    Thank you so much for the video. One of my favourite teachers on youtube. Keep up the great work.

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

    You are awesome, @john!! I have looked all throughout github and various tutorials to not reinvent the wheel. No luck. All of the examples were too out of date (vue 2) or were using a css template which muddied the waters. Your video tut was on point! And it did not take me very long to transform it into a vue 3 tag! Please keep teaching.

  • @frankkevy
    @frankkevy 3 года назад +3

    It's refreshing to explore a channel with tutorials using the latest versions of frameworks. Tired of Vue 2 tutorials everywhere

  • @cjmaaz
    @cjmaaz 3 года назад +3

    Thanks for the video John!
    I suggest you to create shorts of some important part of the video just to please YT algorithm for the reach (in free time, don't overwork).

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

      I’ll have to consider that! Thank you for the tip!

  • @softblood1941
    @softblood1941 3 года назад +5

    I really want to see a full stack graphQL server with Vue and apollo client project and some more real world projects if you have time!!

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

      Definitely have some more bigger/practical projects coming up soon!

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

    You are awesome. Thanks for all the amazing contents and stunning projects.🤗

  • @LoveIyMan
    @LoveIyMan 9 месяцев назад

    You are exactly what I want

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

    Awesome video John. Very informative as always!

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

    very well explained, thank you

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

    Works very well, thank you very much!

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

    동영상강의 잘 시청하였습니다. 시간이 되신다면, slot 관련해서 강의를 하나 부탁드립니다. 감사합니다.

  • @lars-sorensen
    @lars-sorensen 3 года назад

    Love your Vue videos!

  • @ajjordi96
    @ajjordi96 3 года назад +6

    Awesome content John! Could you do the same for a responsive navbar? Firebase tutorials are great and not much content on Vue and Firebase around, I think that would be great too! Keep it up!

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

      I do have a video on a responsive navigation menu using the options API. In the future, I could redo that using the options api! But I do have more videos with vue 3 and fire base coming up soon!

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

    ultimate tutorial, more than I required and best part is explaining the css. I did not know sass but thanks to you, i learnt a little now. but how to close modal if i move cursor outside the modal box?

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

    Thank you so much.

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

    Hey thank you so much, I tried but was not able to understand how to open a modal component from parent component but you literally explained it in a minute.
    Keep doing good and stay healthy and happy
    PS: can you make a vue 3 project with script setup tag (composition api) and state management using vuex4 or Pinia whatever you prefer with tailwind it would be awesome

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

      Glad it could help! I'll have a slightly larger project out soon!

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

    thank you

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

    Thanks!

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

    Thanks

  • @mac2431
    @mac2431 10 месяцев назад

    i love you

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

    Thanks. John. I greatly appreciate your efforts. What does router history mode do?

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

      Thanks mounir! Here is a link to the Vue docs, which would probably do a much better job at explaining it then i could here! router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations

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

      @@JohnKomarnicki Thanks again. John for the help.

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

    This is very nice video Jan. I really like it.
    But two main imperfections can cause problems with this approach... or correct me if i'm wrong :)
    1. Modal only emits close action and changing it's visibility is done in parent component. So as I understand, you will have to copy/paste "close" function in every component containing Modal
    2. What if one component will have two (or more) different Modals?

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

      1. Not exactly. The $emit function exists on modal component. Therefore, you'll just need to listen to the emit in the component where you are using that modal component. You would have to have a toggle function in each component you use, which is not uncommon to do.
      2. There is a few things you can do here. Here is how i would do this, but there is other ways. You could just simply have two modals, and just created different data values hide/show modal. Such as "modal1" & "modal2", Now with this, you would have two different functions, or create a function that takes an argument to properly show / hide the correct modal. Hopefully that makes sense.

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

    when i import the Modal to my parent component, the child component is shown in the script (Modal gets green) and not in the template (Modal is shown as plain text ). As a result i cant reuse the child component.
    Can someone help me plz

  • @rafysancheztilogica8587
    @rafysancheztilogica8587 11 месяцев назад

    What extensions were you using ?

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

    Can you make video about reusability composition api ?
    Ex: we have a form that include 2 fields(all fields are select - option). So, How can I split these 2 fields for reuse?

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

      Ah like a reusable input component?

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

      @@JohnKomarnicki yes, but it has different methods

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

    Is it worth to learn Vue when I'm changing from backend to full frontend after two years? Not sure If I get a job with that framework, especially in Poland.

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

      Vue, in my opinion has the easiest learning curve coming from traditional/vanilla js compared to Angular or React. Vue, is certainly at the moment is not as popular as react, but it has been gaining momentum over the past several years.
      I personally enjoy it a lot, but everyone has different reasons/perspectives to choosing a framework. You'd have to evaluate the current job market within your area, then make your choice!

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

      @@JohnKomarnicki Thanks for an answer.

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

    Great content btw, the Github repo link is not working,

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

      What is wrong with it? I just clicked on it, and it was working for me.

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

      Sorry, it appears it was on private. It is on public now :)

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

      @@JohnKomarnicki thanks 🙏

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

    I prefer build modal without boolean v-model

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

      I’m always up for different approaches, how would you do it?