How vue listens for out-of-focus events

first of all, the source code is like this

input(v-model="num" @keyup="search") -sharp 
.prompt(v-show="lists!=0") -sharp 
  .list(v-for="(i,n) in lists" :key="n") {{i.name}}

how vue listens to let the prompt index box hide when the input box loses focus

prompt there is already a v-show on the body. If you add another event, who should add it to


@ blur= "fun ()"


now you also know that @ blur loses focus and triggers hidden prompts in the fun (), fun (). You mainly don't understand how to hide the prompt search box in the fun () function. You can define a flag to true or false, to show or hide, and you can change the flag in the function

.
Menu