This commit is contained in:
Tobias Wohlleben 2025-03-11 22:05:59 +01:00
commit b0dae6ff5c
3 changed files with 33 additions and 4 deletions

View File

@ -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 -->
@ -44,6 +44,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>
@ -51,12 +54,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>

View File

@ -15,6 +15,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;

View File

@ -41,5 +41,9 @@ module.exports = {
}, },
historyApiFallback: true historyApiFallback: true
}, },
performance: {
hints: false,
maxEntrypointSize: 512000,
maxAssetSize: 512000
}
} }