VueJS Showing and Hiding Messages

前端 未结 4 1244
独厮守ぢ
独厮守ぢ 2021-01-14 06:43

I have a basic CLI structure environment created. I have a component to display messages/alerts Ie: Login Failed etc…

Since this component is going to be reused thro

4条回答
  •  遥遥无期
    2021-01-14 07:26

    You Should hide it inside your alert component using the created life cycle to hide it like this:

    `

      created: {
    
             setTimeout(() => this.message = [], 1000)
      }
    

提交回复
热议问题