jiuyiUniapp/jiuyi2/TUIKit/components/TUIConversation/conversation-network/index.vue

34 lines
727 B
Vue
Raw Normal View History

2024-12-18 15:46:27 +08:00
<template>
<div
v-if="isNotNetwork"
class="network"
>
<i class="icon icon-error">!</i>
<p class="network-content">
{{
TUITranslateService.t("TUIConversation.网络异常,请您检查网络设置")
}}
</p>
</div>
</template>
<script lang="ts" setup>
import TUIChatEngine, {
TUIStore,
StoreName,
TUITranslateService,
} from '@tencentcloud/chat-uikit-engine';
import {
ref,
} from '../../../adapter-vue';
const isNotNetwork = ref(false);
TUIStore.watch(StoreName.USER, {
netStateChange: (value: string) => {
isNotNetwork.value = (value === TUIChatEngine.TYPES.NET_STATE_DISCONNECTED);
},
});
</script>
<style lang="scss" scoped src="../style/index.scss"></style>