Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

hide div after 5 seconds vue js

<template>
    <div>
        <h1 v-show="elementVisible" class="hideElement"> HELLO </h1>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                elementVisible: true
            }
        },

        created() {
            setTimeout(() => this.elementVisible = false, 5000)
        }
    }
</script>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #hide #div #seconds #vue #js
ADD COMMENT
Topic
Name
8+7 =