|
5 年之前 | |
---|---|---|
dist | 5 年之前 | |
src | 5 年之前 | |
test | 5 年之前 | |
.gitignore | 5 年之前 | |
README.md | 5 年之前 | |
babel.config.js | 5 年之前 | |
index.html | 5 年之前 | |
jest.config.js | 5 年之前 | |
package-lock.json | 5 年之前 | |
package.json | 5 年之前 | |
webpack.mix.js | 5 年之前 |
<script src="https://cdn.jsdelivr.net/gh/minimaljs/minimal/dist/minimal.min.js"></script>
<div x-data="{ show: true }">
<button x-on:click="$data.show = ! $data.show">toggle</button>
<div x-bind:class="{ 'hidden': ! $data.show }">...</div>
</div>
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