mirror of
https://github.com/hahwul/WebHackersWeapons.git
synced 2025-02-23 16:40:05 -05:00
Update default.html
This commit is contained in:
parent
73e8cd2e04
commit
0da3dfa926
@ -79,8 +79,10 @@
|
|||||||
<td>
|
<td>
|
||||||
<input type="checkbox" v-model="checked" :value="lang.id" number>
|
<input type="checkbox" v-model="checked" :value="lang.id" number>
|
||||||
</td>
|
</td>
|
||||||
|
{ % raw % }
|
||||||
<td> {{ lang.id }}</td>
|
<td> {{ lang.id }}</td>
|
||||||
<td> {{ lang.name }}</td>
|
<td> {{ lang.name }}</td>
|
||||||
|
{ % endraw % }
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@ -90,33 +92,33 @@
|
|||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.3.4/vue.min.js">
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.3.4/vue.min.js">
|
||||||
<script>
|
<script>
|
||||||
window.onload = function(){
|
window.onload = function(){
|
||||||
new Vue({
|
new Vue({
|
||||||
data: {
|
data: {
|
||||||
langs: [
|
langs: [
|
||||||
{ "id": "1", "name": "Edward"},
|
{ "id": "1", "name": "Edward"},
|
||||||
{ "id": "2", "name": "Lance"},
|
{ "id": "2", "name": "Lance"},
|
||||||
{ "id": "3", "name": "Arellano"},
|
{ "id": "3", "name": "Arellano"},
|
||||||
{ "id": "4", "name": "Lorilla"},
|
{ "id": "4", "name": "Lorilla"},
|
||||||
],
|
],
|
||||||
checked: []
|
checked: []
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
checkAll: {
|
checkAll: {
|
||||||
get: function () {
|
get: function () {
|
||||||
return this.langs ? this.checked.length == this.langs.length : false;
|
return this.langs ? this.checked.length == this.langs.length : false;
|
||||||
},
|
},
|
||||||
set: function (value) {
|
set: function (value) {
|
||||||
var checked = [];
|
var checked = [];
|
||||||
if (value) {
|
if (value) {
|
||||||
this.langs.forEach(function (lang) {
|
this.langs.forEach(function (lang) {
|
||||||
checked.push(lang.id);
|
checked.push(lang.id);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
this.checked = checked;
|
||||||
}
|
}
|
||||||
this.checked = checked;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}).$mount('#app');
|
||||||
}).$mount('#app');
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user