|
5 years ago | |
---|---|---|
dist | 5 years ago | |
src | 5 years ago | |
test | 5 years ago | |
.gitignore | 5 years ago | |
README.md | 5 years ago | |
babel.config.js | 5 years ago | |
index.html | 5 years ago | |
jest.config.js | 5 years ago | |
package-lock.json | 5 years ago | |
package.json | 5 years ago | |
webpack.mix.js | 5 years ago |
<script src="https://cdn.jsdelivr.net/gh/minimaljs/minimal/dist/minimal.min.js"></script>
Dropdown
<div x-data="{ hide: true }">
<button x-on:click="$data.hide = false">...</button>
<ul class="hidden" x-bind:class="{ 'hidden': $data.hide }" :click="$data.hide = true">
...
</ul>
</div>
Modal
<div x-data="{ show: true }">
<button x-on:click="$data.show = ! $data.show">toggle</button>
<div x-bind:class="{ 'hidden': ! $data.show }">...</div>
</div>
Tabs
You can bind expressions to any attribute using x-bind
, and you can run expressions on any event using x-on
.
The data is "reactive", when some data updates, only the expressions conscerned with it will.
$data.show
and just use show