mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-22 06:49:35 +00:00
.
This commit is contained in:
1 parent
44ea5c5927
commit
07595eb34a
3 files changed
+30
-21
No files matched your search
@@ -8,7 +8,7 @@
|
||||
<script>
|
||||
import { debounce } from 'lodash-es'
|
||||
import ASearchResultTeam from '@/plugins/lib@search/search/_components/a-search-result-team.vue'
|
||||
import ASearchResultTasks from '@/plugins/lib@search/search/_components/a-seach-result-task.vue'
|
||||
import ASearchResultTasks from '@/plugins/lib@search/search/_components/a-search-result-task.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -24,21 +24,27 @@ export default {
|
||||
},
|
||||
|
||||
created() {
|
||||
try {
|
||||
this.searchResults = this.$axios.get_auth_data('v1/search')
|
||||
} catch (error) {
|
||||
this.$toast.error(error)
|
||||
}
|
||||
|
||||
this.$events.on('onSearch', (search) => {
|
||||
this.search = search
|
||||
})
|
||||
},
|
||||
|
||||
watch: {
|
||||
search(newVal) {
|
||||
this.updateSearchResults(newVal)
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
debounceSearch: debounce(function () {
|
||||
this.search()
|
||||
}, 300),
|
||||
updateSearchResults: debounce(async function (search) {
|
||||
try {
|
||||
this.searchResults = await this.$axios.get_auth(`v1/search?q=${search}`)
|
||||
// const { mastertasks: mastertasks.data, subtasks: subtasks.data, teams: teams.data}
|
||||
console.log(this.searchResults)
|
||||
} catch (error) {
|
||||
this.$toast.error(error)
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in new issue
Block a user