“Alpine JS” Code-Antworten

Alpine JS

<div x-data="{ open: false }">
    <button @click="open = true">Open Dropdown</button>

    <ul
        x-show="open"
        @click.away="open = false"
    >
        Dropdown Body
    </ul>
</div>
Worried Wolverine

Alpine JS

< script  src = " https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.min.js " defer > </ script >
chance 2.0

Alpinejs

<html>  <head>    ...     <script defer src="https://unpkg.com/[email protected]/dist/cdn.min.js"></script>  </head>  ...</html>
Faithful Fly

Alpine JS

<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>
WebSanta

Ähnliche Antworten wie “Alpine JS”

Fragen ähnlich wie “Alpine JS”

Weitere verwandte Antworten zu “Alpine JS” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen