fix(front): watch channel widget data, so the user doesnt need to refresh by hand
This commit is contained in:
parent
497908f1d3
commit
872a5d0250
|
@ -1,7 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { BackendError, BackendResponse, Channel } from '~/types'
|
import type { BackendError, BackendResponse, Channel } from '~/types'
|
||||||
|
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, onMounted, watch, reactive } from 'vue'
|
||||||
import { clone } from 'lodash-es'
|
import { clone } from 'lodash-es'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@ const nextPage = ref()
|
||||||
const count = ref(0)
|
const count = ref(0)
|
||||||
|
|
||||||
const isLoading = ref(false)
|
const isLoading = ref(false)
|
||||||
|
|
||||||
const fetchData = async (url = 'channels/') => {
|
const fetchData = async (url = 'channels/') => {
|
||||||
isLoading.value = true
|
isLoading.value = true
|
||||||
|
|
||||||
|
@ -57,7 +58,13 @@ const fetchData = async (url = 'channels/') => {
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchData()
|
onMounted(() => {
|
||||||
|
fetchData()
|
||||||
|
})
|
||||||
|
|
||||||
|
watch(() => props.filters, () => {
|
||||||
|
fetchData()
|
||||||
|
}, { deep: true })
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
Loading…
Reference in New Issue