found that filter has been removed from the vue js
The template filter that was deprecated in Vue is not the same as Javascript's Array.filter method.
Use v-model rather than v-bind on the checkboxes and everything should be working.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
with using filter function it doesn't works , goggled and found that filter has been removed from the vue js use instead?
I want when I click on the checkbox the completed items are shown in the completed section...
my code
<div id="app">
<section class="flex justify-center mt-32 ">
<ul>
<h2 class="font-bold mb-2">In Progress</h2>
<li v-for="assignment in assignments">
<label>
{{ assignment.name }}
<input type="checkbox" v-bind="assignment.complete">
</label>
</li>
</ul>
</section>
<section class="flex justify-center mt-8 h-full">
<ul>
<h2 class="font-bold mb-2">Completed</h2>
<li v-for="assignment in assignments.filter(a => a.complete)">
<label for="name">
{{ assignment.name }}
</label>
<input type="checkbox" v-bind="assignment.complete">
</li>
</ul>
</section>
</div>
<script>
Vue.createApp({
data() {
return {
assignments : [
{name : 'Finshed Projects', complete : false},
{name : 'Read Chapter ', complete : false},
{name : 'Turn in homework', complete : false},
]
};
}
}).mount('#app')
</script>
but i don't want to see it untill it completed
I don't know what you mean TBH... anyway this example (based on your original) would display two lists; the In Progress and Completed based on the state of complete property of each assignment in the original Array:
<template>
<div id="app">
<section class="flex justify-center mt-32 ">
<ul>
<h2 class="font-bold mb-2">In Progress</h2>
<li v-for="assignment in in_progress" :key="assignment.name">
<label>
{{ assignment.name }}
<input type="checkbox" v-model="assignment.complete">
</label>
</li>
</ul>
</section>
<section class="flex justify-center mt-8 h-full">
<ul>
<h2 class="font-bold mb-2">Completed</h2>
<li v-for="assignment in completed" :key="assignment.name">
<label for="name">
{{ assignment.name }}
</label>
<input type="checkbox" v-model="assignment.complete">
</li>
</ul>
</section>
</div>
</template>
<script>
Vue.createApp({
data() {
return {
assignments: [
{ name: "Finshed Projects", complete: false },
{ name: "Read Chapter ", complete: false },
{ name: "Turn in homework", complete: false }
]
};
},
computed: {
in_progress() {
return this.assignments.filter((a) => !a.complete);
},
completed() {
return this.assignments.filter((a) => a.complete);
}
}
}).mount("#app");
</script>
Please or to participate in this conversation.