Skip to content

Commit

Permalink
Alterações no componente searchInput
Browse files Browse the repository at this point in the history
* Faltando mover getStudents() de activeStudents para watch (mudar dinamicamente)
  • Loading branch information
Lakshamana committed May 13, 2019
1 parent 0b4f73e commit 5687227
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
24 changes: 20 additions & 4 deletions components/searchInput.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<template>
<div>
<br />
<br />
<div class="container">
<div class="columns is-centered">
<h1 class="title">
<strong>{{ title }}</strong>
</h1>
</div>
<br />
<div class="columns is-centered">
<div v-if="students.length" class="columns is-centered">
<div class="column is-half">
<div class="control has-icons-left">
<b-input
Expand Down Expand Up @@ -40,7 +38,9 @@
</template>

<script>
import { Toast } from 'buefy/dist/components/toast'
import studentComboBox from '../components/studentComboBox'
export default {
name: 'SearchInput',
// props: ['title', 'students', 'thead'],
Expand Down Expand Up @@ -79,6 +79,7 @@ export default {
]
}
},
computed: {
filteredList() {
return this.students.filter(student => {
Expand All @@ -91,6 +92,21 @@ export default {
)
})
}
},
mounted() {
if (this.students.length < 1) {
Toast.open({
message: 'Não há alunos ativos neste curso',
type: 'is-danger'
})
}
}
}
</script>

<style scoped>
.container {
margin: 50px auto 50px auto;
}
</style>
6 changes: 0 additions & 6 deletions pages/activeStudents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,3 @@ export default {
}
}
</script>

<style scoped>
.container {
margin: 20px auto 50px auto;
}
</style>

0 comments on commit 5687227

Please sign in to comment.