This commit is contained in:
lalBi94 2023-03-05 15:37:25 +01:00
parent 678fb0e3b0
commit bfe501b9f9

View File

@ -76,14 +76,18 @@
state: {
page: {
curIndex: 0,
cat: null,
cat: [2],
name: [
"formation",
"filière de formation",
"filière de formation détaillée"
],
},
data: null
data: []
},
updateCat(category, value) {
this.update(this.state.page.cat[category] = value)
},
previousPage(){
@ -91,7 +95,6 @@
if(this.state.page.curIndex-1 >= 0) {
this.update({ curIndex: this.state.page.curIndex-- });
}
console.log(this.state.page.curIndex)
} catch(e) {
console.error(e)
}
@ -102,7 +105,6 @@
if(this.state.page.curIndex+1 <= 2 ) {
this.update({ curIndex: this.state.page.curIndex++ });
}
console.log(this.state.page.curIndex)
} catch(e) {
console.error(e)
}
@ -121,7 +123,7 @@
onBeforeMount() {
this.getData();
}
},
};
</script>
@ -136,9 +138,9 @@
</div>
<div id="selector-list-container">
<ul id="selector-list">
<ul if={ this.state.page.curIndex == 0 } id="selector-list">
<li each={ item in this.state.data } class="selector-list-inner">
<a onclick={ nextPage } class="selector-list-names">{ item.name }</a>
<a onclick={ nextPage } href={`?option1=${item.name}`} class="selector-list-names">{ item.name }</a>
<span class="selector-list-counts">{ item.count }</span>
</li>
</ul>