Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
AlpineJS ile tab bileşeni yapımı
<script src=""></script>
<div x-data="{ tab: 'main' }">
<a :class="{ 'active': tab === 'main' }" @click="tab = 'main'" href="#main" >Ana sayfa</a>
<a :class="{ 'active': tab === 'about' }" @click="tab = 'about'" href="#about">Hakkımızda</a>
<a :class="{ 'active': tab === 'contact' }" @click="tab = 'contact'" href="#contact">İletişim</a>
<div x-show="tab === 'main'">Ana sayfa</div>
<div x-show="tab === 'about'">Hakkımızda</div>
<div x-show="tab === 'contact'">İletişim</div>
a { text-decoration: none; padding: 5px; } { background-color: dodgerblue; color: #fff; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment