Vue.js Tutorial From Scratch - e14 - Autocomplete

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 พ.ย. 2024

ความคิดเห็น • 68

  • @Webnoob
    @Webnoob 5 ปีที่แล้ว +3

    Excellent explanation, but my opinion is filteredStates as computed property is better. Your method will be executed every key stroke, even if nothing has changed in your filteredStates array. It‘s better performance-wise if you using a computed property in this case.

    • @CodersTape
      @CodersTape  5 ปีที่แล้ว +2

      That’s a great observation. And I agree. A computed property would have some performance benefits.

  • @BoNinjaFTW
    @BoNinjaFTW ปีที่แล้ว +3

    For anyone building this in vue 3, at 6:25, dont add the "this." in front of "state" on line 22 as this will cause an error.

  • @Dausten_
    @Dausten_ 2 ปีที่แล้ว +1

    if you dont want to build a div in minuto 11:40, you can use this:
    And create a method:
    desactivate(){
    setTimeout(() => this.modal = false, 100);
    }

  • @mpsimon4641
    @mpsimon4641 4 ปีที่แล้ว +3

    If you don;t have a post.css.config:
    Run:
    npx tailwindcss init
    Which will make an tailwind.config.js
    And use this

    • @floflo111
      @floflo111 4 ปีที่แล้ว

      it doesn't work for me

    • @robertstefanic4001
      @robertstefanic4001 4 ปีที่แล้ว

      @@floflo111 If you're having problems with the tailwind directive ("@tailwind" in your CSS file), try importing the files instead of using the directives (it worked for me). Still run 'npx tailwindcss init', and add a 'postcss.config.js' file to the root of your project, following along with the video and adding the plugins. Then, after that, fix the tailwind directives.
      So replace:
      @tailwind base;
      @tailwind components;
      @tailwind utilities;
      With this:
      @import "tailwindcss/base";
      @import "tailwindcss/components";
      @import "tailwindcss/utilities";

    • @floflo111
      @floflo111 4 ปีที่แล้ว

      @@robertstefanic4001 thanks for reply, I thought I deleted this comment. Just created a new js file with that name and wrote the code. It worked fine, but I will try your solution also. Thanks

  • @dramen555
    @dramen555 5 ปีที่แล้ว +1

    you could use blur instead of clicking a wrapper. Like focus shows, blur hides.

    • @CodersTape
      @CodersTape  5 ปีที่แล้ว +1

      It wouldn’t work when you click on one of the filtered states. Give it a try.

    • @dramen555
      @dramen555 5 ปีที่แล้ว +2

      @@CodersTape yeah you are right if you use click event on list items. But if you use @mousedown instead of click on list items, mousedown event will trigger before blur, so it will work. By the way, love your videos. Just trying to give you my thoughts.

    • @CodersTape
      @CodersTape  5 ปีที่แล้ว +1

      That's a good alternative. Either one would work. And thanks for your comments, I love hearing the feedback, keep them coming. I always find myself looking at all of the different ways to solve problems, I don't always have the best answer! :)

    • @thehijacker7
      @thehijacker7 3 ปีที่แล้ว

      @@dramen555 Thanks, I resolved same issue with your hint. ;-)

  • @laragram
    @laragram 5 ปีที่แล้ว +2

    Just found your channel and I love it!

  • @thiagotanaka2290
    @thiagotanaka2290 4 ปีที่แล้ว +4

    nice tutorial , thank you.
    after setState I did like this
    setState(state){
    this.state = state
    this.filteredStates = []
    }

  • @thuyoanh-lq6mn
    @thuyoanh-lq6mn 4 ปีที่แล้ว +5

    I follow all instruction from your video, but i cant find file post.css.config after run Vue CLI

    • @sgp2928
      @sgp2928 4 ปีที่แล้ว

      i think it's a version issue, however, the documentation say that vue use postcss internally so i just create the file and it worked.

  • @Vemovemo1
    @Vemovemo1 4 ปีที่แล้ว

    Great tutorial!! question, what extension do you use ( Code ) to show the contextual menu options while you type? thanks

  • @kmtsvetanov
    @kmtsvetanov 4 ปีที่แล้ว +1

    Great job, but i think there is a bug...
    if you set "position absolute inset-0" you can't click the Home in the main App.vue

  • @MuhammadAdnan-gx6rd
    @MuhammadAdnan-gx6rd 5 ปีที่แล้ว +3

    Superb. .. but auto complete data should come from laravel backend. ....thanks

  • @Dausten_
    @Dausten_ 2 ปีที่แล้ว

    Thanks, good video, very useful

  • @youssefmansour5756
    @youssefmansour5756 2 ปีที่แล้ว

    Wow thanks for the video, i wish if you can create new video like with axios

  • @riasadrion4387
    @riasadrion4387 4 ปีที่แล้ว

    This is some nice level of work. Please keep going....

  • @hugomejia7826
    @hugomejia7826 3 ปีที่แล้ว

    Great explanation, very very clear!! Thanks a lot men!!!

  • @dennisbarnaja4173
    @dennisbarnaja4173 3 ปีที่แล้ว

    Nice tutorial, thank you!

  • @geniusdesign7306
    @geniusdesign7306 2 ปีที่แล้ว

    Thank you so much!!!

  • @miauw8762
    @miauw8762 ปีที่แล้ว +1

    Amazing video

  • @isisoakjsjsjsjs9666
    @isisoakjsjsjsjs9666 5 ปีที่แล้ว +3

    Please I really want laravel socketio (no pusher) realtime chat with rooms (dialog). Please men

  • @user-sv2bn7ev2m
    @user-sv2bn7ev2m 4 ปีที่แล้ว

    Thanks for this! Really nice approach and looks like it can easily be reused across projects.

    • @rodrigoluka453
      @rodrigoluka453 3 ปีที่แล้ว

      I know im randomly asking but does anybody know a method to log back into an instagram account??
      I was stupid forgot the password. I would appreciate any help you can offer me

    • @kasenronin7009
      @kasenronin7009 3 ปีที่แล้ว

      @Rodrigo Luka Instablaster =)

    • @rodrigoluka453
      @rodrigoluka453 3 ปีที่แล้ว

      @Kasen Ronin I really appreciate your reply. I found the site on google and I'm trying it out atm.
      I see it takes a while so I will reply here later when my account password hopefully is recovered.

    • @rodrigoluka453
      @rodrigoluka453 3 ปีที่แล้ว

      @Kasen Ronin It did the trick and I actually got access to my account again. Im so happy!
      Thank you so much, you really help me out :D

    • @kasenronin7009
      @kasenronin7009 3 ปีที่แล้ว

      @Rodrigo Luka glad I could help xD

  • @MM-um1sq
    @MM-um1sq 4 ปีที่แล้ว +2

    [vue/valid-v-for]
    Expected 'v-bind:key' directive to use the variables which are defined by the 'v-for' directive.eslint-plugin-vue
    i have this error in ul>li inAbout.vue what i must to do?

    • @dennisbarnaja4173
      @dennisbarnaja4173 3 ปีที่แล้ว

      You need to add :key to each of tag here

  • @adam192021
    @adam192021 5 ปีที่แล้ว

    The BEST as always!

  • @akashkharade2259
    @akashkharade2259 2 ปีที่แล้ว

    How to apply minLength for autocomplete here? For example after 3rd char, autocomplete should appear.

  • @dawidwojcik7567
    @dawidwojcik7567 3 ปีที่แล้ว

    Thank u bro :D

  • @mepsd
    @mepsd 4 ปีที่แล้ว +2

    i just getting started with vue, i followed your instructions but there is no postcss.config.js file in my directory for setup tailwindcss, i tried to create one but that not work for me. need help

    • @whitmanbohorquez184
      @whitmanbohorquez184 4 ปีที่แล้ว

      me too, it is not generated at create time, dont now what to do

    • @painghtetaung6780
      @painghtetaung6780 4 ปีที่แล้ว

      if you are already created postcss.config.js then just add the extension in vscode(i'm using vscode)
      this is extension check this
      github.com/postcss/postcss#editors--ide-integration

  • @limonrakib9065
    @limonrakib9065 5 ปีที่แล้ว +1

    sir please upload a project with vue.js and laravel.bye the way thank you for this tutorial

  • @seriesaddict
    @seriesaddict 5 ปีที่แล้ว +1

    Hi ! I try to get data from my database so I have created an API to fetch the data I need but I don't know how to get them for my component. How do you do it ? Thanks !

    • @textbytes2273
      @textbytes2273 5 ปีที่แล้ว

      You can pass the data from the API as a property to the component, e.g. in Laravel blade view: . If you don't use Laravel but, for example, a Vue single page application, you can use Axios to fetch your data from the API directly into the autocomplete component.

  • @wilacademy8916
    @wilacademy8916 2 ปีที่แล้ว

    nice

  • @thuyoanh-lq6mn
    @thuyoanh-lq6mn 4 ปีที่แล้ว +1

    i see the postcss.config.js. How to add the file postcss.config.js?

  • @bashovski
    @bashovski 5 ปีที่แล้ว +1

    First! Thanks for this amazing tutorial!

  • @juancastrence8638
    @juancastrence8638 4 ปีที่แล้ว +1

    Doesn't seem to work when I fetch my data from an endpoint, though. It only works if the data is hardcoded in the Vue file. Any clue why that might be the case?

    • @thyagobomfim4751
      @thyagobomfim4751 3 ปีที่แล้ว

      Eu também estou com esse mesmo problema, como você resolveu?

  • @michaelpaxman9731
    @michaelpaxman9731 4 ปีที่แล้ว +2

    What was the reason for writing all of this?
    When you could achieve the same effect by just adding an @blur event like below?
    @blur="modal = false"

  • @classicguy7813
    @classicguy7813 4 ปีที่แล้ว

    Hi how to input data to autocomplete

  • @JoshuaKisb
    @JoshuaKisb 4 ปีที่แล้ว +1

    filteredStates should be computed then you'd have much shorter code. no mount no watch

  • @schulprojektewvss6774
    @schulprojektewvss6774 3 ปีที่แล้ว

    So but when i clear my Input now, i get a list with all entries in the total List, is there any way to make it shorter? 500 items are not the best to show on mobile

    • @schulprojektewvss6774
      @schulprojektewvss6774 3 ปีที่แล้ว

      Answer is v-for="item in list.slice(0,5)".... shows only 5 entries in total

  • @pujamitra982
    @pujamitra982 4 ปีที่แล้ว

    After typing, suppose Alas for Alaska, when I backspace the letters to have no value in input box, all the suggestions are displayed.. any alternative?

    • @dennisbarnaja4173
      @dennisbarnaja4173 3 ปีที่แล้ว

      add if condition like this. if (this.state.length>0) { return state.toLowerCase().startsWith(this.state.toLowerCase()) }

  • @jesuscuellar9866
    @jesuscuellar9866 2 ปีที่แล้ว

    where is the code of that auto-complete input

  • @wahyono1739
    @wahyono1739 5 ปีที่แล้ว

    i using laravel with npm install. and can not find tailwind.js under resource directory...with out tailwind its not working

    • @CodersTape
      @CodersTape  5 ปีที่แล้ว

      If you mean the tailwind.config.js file, then that needs to be created using npx. Look at the tailwind documentation installation section, to find it.

  • @RicardoTorres5
    @RicardoTorres5 4 ปีที่แล้ว

    If anyone is struggling to complete this exercise, I finished it on JSFiddle to get the countries list from an API, hope somebody finds it useful: jsfiddle.net/qtLk3u8j/35/