0
0
Fork 0

add onUpdated to allow the data to be updated when the url changes

This commit is contained in:
Pau 2022-11-23 08:06:59 +01:00
parent ef0ea4f503
commit e864843c28
2 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { onMounted, computed, ref } from 'vue'; import { onMounted, computed, ref, onUpdated } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useSession } from 'src/composables/useSession'; import { useSession } from 'src/composables/useSession';
@ -18,6 +18,8 @@ onMounted(async () => {
await fetch(); await fetch();
}); });
onUpdated(async () => await fetch());
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
const { getToken } = useSession(); const { getToken } = useSession();

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { ref, onMounted, computed } from 'vue'; import { ref, onMounted, computed, onUpdated } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
@ -8,6 +8,8 @@ import workerDescriptorDialog from './WorkerDescriptorDialog.vue';
onMounted(() => fetch()); onMounted(() => fetch());
onUpdated(() => fetch());
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
const quasar = useQuasar(); const quasar = useQuasar();