Add task search term to query param to enable navigation
This commit is contained in:
parent
f2fec2030e
commit
3b18b83239
1 changed files with 11 additions and 4 deletions
|
@ -188,10 +188,10 @@
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// This function initializes the tasks page and loads the first page of tasks
|
// This function initializes the tasks page and loads the first page of tasks
|
||||||
initTasks(page) {
|
initTasks(page, search = '') {
|
||||||
this.taskEditTask = null
|
this.taskEditTask = null
|
||||||
this.isTaskEdit = false
|
this.isTaskEdit = false
|
||||||
this.loadTasks(page)
|
this.loadTasks(page, search)
|
||||||
},
|
},
|
||||||
addTask() {
|
addTask() {
|
||||||
if (this.newTaskText.length < 3) {
|
if (this.newTaskText.length < 3) {
|
||||||
|
@ -261,7 +261,11 @@
|
||||||
if (typeof e.page === 'undefined') {
|
if (typeof e.page === 'undefined') {
|
||||||
page = 1
|
page = 1
|
||||||
}
|
}
|
||||||
this.initTasks(page)
|
let search = e.search
|
||||||
|
if (typeof e.search === 'undefined') {
|
||||||
|
search = ''
|
||||||
|
}
|
||||||
|
this.initTasks(page, search)
|
||||||
},
|
},
|
||||||
markAsDone(e) {
|
markAsDone(e) {
|
||||||
let updateFunc = () => {
|
let updateFunc = () => {
|
||||||
|
@ -326,7 +330,10 @@
|
||||||
if (this.searchTerm === '') {
|
if (this.searchTerm === '') {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.loadTasks(1, this.searchTerm)
|
this.$router.push({
|
||||||
|
name: 'showList',
|
||||||
|
query: {search: this.searchTerm}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
hideSearchBar() {
|
hideSearchBar() {
|
||||||
// This is a workaround.
|
// This is a workaround.
|
||||||
|
|
Loading…
Add table
Reference in a new issue