File tree Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,13 @@ export default {
20
20
. catch ( ( ) => { } ) ;
21
21
} ) ;
22
22
} ,
23
- formatDateTime
23
+ formatDateTime,
24
+ editHandler ( ) {
25
+ this . $router . push ( {
26
+ name : `${ this . $options . servicePrefix } Update` ,
27
+ params : { id : this . item [ '@id' ] }
28
+ } ) ;
29
+ }
24
30
} ,
25
31
watch : {
26
32
error ( message ) {
Original file line number Diff line number Diff line change 3
3
<slot name =" left" ></slot >
4
4
<v-spacer />
5
5
<div >
6
+ <v-btn
7
+ v-if =" handleEdit"
8
+ :loading =" isLoading"
9
+ color =" primary"
10
+ @click =" editItem"
11
+ >
12
+ {{ $t('Edit') }}
13
+ </v-btn >
6
14
<v-btn
7
15
v-if =" handleSubmit"
8
16
:loading =" isLoading"
@@ -55,6 +63,10 @@ export default {
55
63
};
56
64
},
57
65
props: {
66
+ handleEdit: {
67
+ type: Function ,
68
+ required: false
69
+ },
58
70
handleSubmit: {
59
71
type: Function ,
60
72
required: false
@@ -87,6 +99,11 @@ export default {
87
99
this .handleAdd ();
88
100
}
89
101
},
102
+ editItem () {
103
+ if (this .handleEdit ) {
104
+ this .handleEdit ();
105
+ }
106
+ },
90
107
submitItem () {
91
108
if (this .handleSubmit ) {
92
109
this .handleSubmit ();
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div >
3
- <Toolbar :handle-delete =" del" >
3
+ <Toolbar :handle-edit = " editHandler " :handle- delete =" del" >
4
4
<template slot="left">
5
5
<v-toolbar-title v-if =" item" >\{{
6
6
`${$options.servicePrefix} ${item['@id']}`
You can’t perform that action at this time.
0 commit comments