Recently, while working on my HTML blade, I created a Showdate
function. However, I encountered a strange issue where the code seemed to run twice and output the data two times. The function had been functioning perfectly before this incident. Below is the code snippet inside the blade:
<div v-for="day in Days">
<p >@{{ShowDate(day.Date)}}</p>
</div>
When running the above code with
Days:[{Date:"2021-03-06"},{Date:"2021-03-07"},{Date:"2021-03-08"}]
, the console logged the following results:
2021-03-07
2021-03-08
2021-03-06
2021-03-07
2021-03-08
2021-03-06
Here is the function causing the issue:
ShowDate: function(date) {
return date
},