33
33
</template >
34
34
35
35
<script setup>
36
- import { computed , onMounted , ref } from " vue" ;
36
+ import { computed , onMounted , ref , watch } from " vue" ;
37
37
import { useRoute } from " vue-router/composables" ;
38
38
import { useStore } from " @/store" ;
39
39
import config from " @/config.js" ;
@@ -54,13 +54,17 @@ const invoiceTitle = computed(() =>
54
54
onMounted (() => {
55
55
store .commit (" reloadBtn/setCallback" , {
56
56
type: " invoices/get" ,
57
- params: route . params ? . uuid ,
57
+ params: invoiceId . value ,
58
58
});
59
59
selectedTab .value = route .query .tab || 0 ;
60
60
61
61
refreshInvoice ();
62
62
});
63
63
64
+ const invoiceId = computed (() => {
65
+ return route .params .uuid ;
66
+ });
67
+
64
68
const isInvoiceLoading = computed (() => {
65
69
return store .getters [" invoices/isLoading" ];
66
70
});
@@ -86,12 +90,16 @@ function navTitle(title) {
86
90
87
91
const refreshInvoice = async () => {
88
92
try {
89
- await store .dispatch (" invoices/get" , route . params . uuid );
93
+ await store .dispatch (" invoices/get" , invoiceId . value );
90
94
document .title = ` ${ invoiceTitle .value } | NoCloud` ;
91
95
} catch (e) {
92
96
store .commit (" snackbar/showSnackbarError" , { message: e .message });
93
97
}
94
98
};
99
+
100
+ watch (invoiceId, () => {
101
+ refreshInvoice ();
102
+ });
95
103
< / script>
96
104
97
105
< script>
0 commit comments