init 5
This commit is contained in:
parent
14d0834a18
commit
3e3e177a84
@ -1,5 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en" xmlns:x-on="http://www.w3.org/1999/xhtml">
|
<html lang="en" xmlns:x-on="http://www.w3.org/1999/xhtml" xmlns:x-bind="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
<!-- Basic Page Needs –––––––––––––––––––––––––––––––––––––––––––––––––– -->
|
<!-- Basic Page Needs –––––––––––––––––––––––––––––––––––––––––––––––––– -->
|
||||||
@ -47,6 +47,9 @@
|
|||||||
<table class="u-full-width">
|
<table class="u-full-width">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th>
|
||||||
|
<input type="checkbox" x-on:click="checkItems" />
|
||||||
|
</th>
|
||||||
<th>Workshop ID</th>
|
<th>Workshop ID</th>
|
||||||
<th>Titel</th>
|
<th>Titel</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -54,12 +57,16 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<template x-for="item in items" :key="item.id">
|
<template x-for="item in items" :key="item.id">
|
||||||
<tr>
|
<tr>
|
||||||
|
<td>
|
||||||
|
<input type="checkbox" x-on:click="checkItem" x-model="checkedItems" x-bind:value="item" class="checkbox"/>
|
||||||
|
</td>
|
||||||
<td x-text="item.id"></td>
|
<td x-text="item.id"></td>
|
||||||
<td x-text="item.title"></td>
|
<td x-text="item.title"></td>
|
||||||
</tr>
|
</tr>
|
||||||
</template>
|
</template>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<span x-text="JSON.stringify(checkedItems)"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
18
src/index.js
18
src/index.js
@ -12,6 +12,24 @@ document.addEventListener('alpine:init', () => {
|
|||||||
ids: '2694448564;2875848298;3290232938',
|
ids: '2694448564;2875848298;3290232938',
|
||||||
items: [],
|
items: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
|
checkedItems: [],
|
||||||
|
checkItem(e) {
|
||||||
|
let checkedItem = e.target.value;
|
||||||
|
console.log('checkedItem', checkedItem);
|
||||||
|
|
||||||
|
let checkbox = document.querySelectorAll('.checkbox').find(cb => cb.value === checkedItem.id);
|
||||||
|
checkbox.checked = e.target.checked;
|
||||||
|
|
||||||
|
console.log(this.checkedItems);
|
||||||
|
},
|
||||||
|
checkItems(e) {
|
||||||
|
if (e.target.checked) {
|
||||||
|
this.checkedItems = this.items;
|
||||||
|
} else {
|
||||||
|
this.checkedItems = [];
|
||||||
|
}
|
||||||
|
console.log(this.checkedItems);
|
||||||
|
},
|
||||||
async getModDescription() {
|
async getModDescription() {
|
||||||
|
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|||||||
@ -33,5 +33,9 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
historyApiFallback: true
|
historyApiFallback: true
|
||||||
},
|
},
|
||||||
|
performance: {
|
||||||
|
hints: false,
|
||||||
|
maxEntrypointSize: 512000,
|
||||||
|
maxAssetSize: 512000
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user