'Why is this loop using Alpine.js repeating multiple times?
I have a very simple x-for array loop using Alpine.js. I can’t seem to figure out why it is repeating multiple times.
<ul x-data="{ skills: ['AWS', 'Terraform', 'PHP', 'Node.js', 'Vue.js', 'Golang', 'Laravel', 'Hugo', 'Docker', 'MySQL', 'Redis', 'Elasticsearch', 'API Design', 'HTML5', 'CSS3', 'Tailwind CSS', 'EC2', 'Lambda', 'RDS', 'ECS', 'S3', 'API Gateway', 'DynamoDB', 'Cloudfront', 'Cloudwatch', 'SQS'] }">
<template x-for="skill in skills" :key="skill">
<li x-text="skill" class="inline-block text-xs bg-gray-200 text-gray-700 rounded-full py-1 px-3 mr-2 mb-2"></li>
</template>
</ul>
Solution 1:[1]
I found that i was including AlpineJs twice, once at <head> and another before </body>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Adham shafik |
