Starting multipage with router
This commit is contained in:
parent
a5b047887d
commit
6b5b7455b5
3 changed files with 15 additions and 14 deletions
File diff suppressed because one or more lines are too long
|
@ -63,7 +63,9 @@
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
<router-link :to="{ name: 'taskdetails', params: { id: task.id }}">
|
||||||
|
<img src="/img/see.svg" alt="Details" width="20" />
|
||||||
|
</router-link>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="container">
|
||||||
<h3>
|
<h3>
|
||||||
Task
|
Task {{ task.id }}
|
||||||
<!-- <p class="context-menu"><img src="/img/menu.svg" width="40" /></p> -->
|
<!-- <p class="context-menu"><img src="/img/menu.svg" width="40" /></p> -->
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
|
@ -10,20 +10,19 @@
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
export default{
|
export default{
|
||||||
|
data: function() {
|
||||||
|
return {
|
||||||
|
task: null
|
||||||
|
}
|
||||||
|
},
|
||||||
mounted: function() {
|
mounted: function() {
|
||||||
let task_id = this.$route.params.id ?? null
|
let task_id = this.$route.params.id ?? null
|
||||||
console.log(task_id)
|
console.log(task_id)
|
||||||
|
|
||||||
if (task_id != null) {
|
if (task_id != null) {
|
||||||
this.$http.get('api.php?a=get_task&id='+task_id)
|
this.$http.get('/api/getTask/'+task_id)
|
||||||
|
.then(response => this.task = response.data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.refreshed-time {
|
|
||||||
text-align: right;
|
|
||||||
font-size: .8rem;
|
|
||||||
}
|
|
||||||
</style>
|
|
Loading…
Add table
Reference in a new issue