I have to insert some data when I press the insert button to the database and I want to see each row then after one 0.5 sec the div will disappeare. I know the code is wrong is just for example to understand.
<?php
$contents = file_get_contents("foo.txt.001");
$pollfields = explode(',', $contents);
foreach ($pollfields as $key) {
$sql = "INSERT INTO keywords (`keys`) VALUES ('".$key."')";
if ($conn->query($sql) === TRUE) {
<div v-if="show" transition="fade" >
<div class="alert alert-success" role="alert">
<strong>$key</strong>
</div>
</div>
echo ;
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
}
?>
<script> new Vue({ el: '#demo', data: { show: true } }) </script>
and this css:
.fade-enter-active, .fade-leave-active {
transition: opacity .5s
}
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
opacity: 0
}