Vue input focus event operation

Insert picture description here
When the mouse is focused in the input, the prompt disappears.
Insert picture description here
Vue cannot be used for focusing foucs: focus=“foucs” binding attribute, I tried to not trigger the foucs focus event, later changed to @focus=“foucs” binding event to trigger

 <el-input @focus="foucs" type="text" v-model="search" placeholder="请输入您现在所在的位置"/>
data () {
    return {
      visible: false
    }
  },
methods: {
    foucs () {
      this.visible = false
    }
  }

Guess you like

Origin blog.csdn.net/qq_44469200/article/details/103684570