<div x-data="{ tab: 'foo' }">
<button :class="{ 'active': tab === 'foo' }" @click="tab = 'foo'">Foo</button>
<button :class="{ 'active': tab === 'bar' }" @click="tab = 'bar'">Bar</button>
<div x-show="tab === 'foo'">索引標籤 Foo</div>
<div x-show="tab === 'bar'">索引標籤 Bar</div>
</div>
This Pen doesn't use any external CSS resources.