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 {
2020 . catch ( ( ) => { } ) ;
2121 } ) ;
2222 } ,
23- formatDateTime
23+ formatDateTime,
24+ editHandler ( ) {
25+ this . $router . push ( {
26+ name : `${ this . $options . servicePrefix } Update` ,
27+ params : { id : this . item [ '@id' ] }
28+ } ) ;
29+ }
2430 } ,
2531 watch : {
2632 error ( message ) {
Original file line number Diff line number Diff line change 33 <slot name =" left" ></slot >
44 <v-spacer />
55 <div >
6+ <v-btn
7+ v-if =" handleEdit"
8+ :loading =" isLoading"
9+ color =" primary"
10+ @click =" editItem"
11+ >
12+ {{ $t('Edit') }}
13+ </v-btn >
614 <v-btn
715 v-if =" handleSubmit"
816 :loading =" isLoading"
@@ -55,6 +63,10 @@ export default {
5563 };
5664 },
5765 props: {
66+ handleEdit: {
67+ type: Function ,
68+ required: false
69+ },
5870 handleSubmit: {
5971 type: Function ,
6072 required: false
@@ -87,6 +99,11 @@ export default {
8799 this .handleAdd ();
88100 }
89101 },
102+ editItem () {
103+ if (this .handleEdit ) {
104+ this .handleEdit ();
105+ }
106+ },
90107 submitItem () {
91108 if (this .handleSubmit ) {
92109 this .handleSubmit ();
Original file line number Diff line number Diff line change 11<template >
22 <div >
3- <Toolbar :handle-delete =" del" >
3+ <Toolbar :handle-edit = " editHandler " :handle- delete =" del" >
44 <template slot="left">
55 <v-toolbar-title v-if =" item" >\{{
66 `${$options.servicePrefix} ${item['@id']}`
You can’t perform that action at this time.
0 commit comments