radiocampus: style update

This commit is contained in:
2024-05-31 14:40:31 +02:00
parent a323901d0e
commit f29cced5f5
66 changed files with 10589 additions and 10 deletions

View File

@ -0,0 +1,41 @@
<template>
<form ref="form">
<slot :counts="counts"></slot>
</form>
</template>
<script>
const splitReg = new RegExp(',\\s*|\\s+', 'g');
export default {
data() {
return {
counts: {},
}
},
methods: {
update() {
const items = this.$el.querySelectorAll('input[name="data"]:checked')
const counts = {};
for(var item of items)
if(item.value)
for(var tag of item.value.split(splitReg))
if(tag.trim())
counts[tag.trim()] = (counts[tag.trim()] || 0) + 1;
this.counts = counts;
},
onclick() {
// TODO: row click => check checkbox
}
},
mounted() {
console.log(this.counts)
this.$refs.form.addEventListener('change', () => this.update())
this.update()
}
}
</script>