Я хочу отфильтровать мои дивы, когда вы нажимаете на флажок на левой стороне, он должен совпадать с названием категории item.categories
.
Как фильтровать, когда я нажимаю на флажок, и это проверено если категория ie то же самое:
![enter image description here](https://i.stack.imgur.com/ScibZ.png)
Вот мой код:
<div class="row">
<div class="col-sm-12 col-md-3 ml-3 rightLine">
<h4 class="text-center">Search internship</h4>
<div class="form-check mt-5">
<div>
<input class="form-check-input checkboxMargin" type="checkbox" v-model="check">
<p class="form-check-label checkboxMargin">Agriculture, Food and Natural Resources</p>
</div>
<div>
<input class="form-check-input checkboxMargin" type="checkbox">
<p class="form-check-label checkboxMargin">Arts, Audio/Video Technology and Communications</p>
</div>
</div>
</div>
Мой код сценария *
<script>
import firebase from "firebase";
import { db } from '../../config/db';
export default {
components: {
name: 'Internship'
},
data() {
return {
title: 'Internship',
items: [],
check: [],
isLoggedIn: false,
currentUser: false
}
},
head: {
title: function () {
return {
inner: this.title
}
}
},
firebase: {
items: db.ref('items')
},
methods: {
deleteItem(key) {
this.$firebaseRefs.items.child(key).remove();
}
},
created() {
if(firebase.auth().currentUser) {
this.isLoggedIn = true;
this.currentUser = firebase.auth().currentUser.email;
}
}
}
</script>