Test internet connection

I would to know if there’s anyway to test the connection for Ionic Vue, to check whether there is internet connection or not. Is there any plugin or any good way to do it?

The VueUse utility library has a useful composable function: useOnline that should do what you need:

<template>
	<div>
		{{ online }}
	</div>
</template>

<script lang="ts">
import { defineComponent } from "vue";
import { useOnline } from "@vueuse/core";

export default defineComponent({
	setup() {
		const online = useOnline();

		return {
			online,
		};
	},
});
</script>