[Vuejs]-Vuejs a function is triggering an infinite loop

0👍

It’s a re-rendering issue ,the user who posted this topic had a similar issue

Infinite loop on axios call, React

You should probably always use an async function and await request calls

export default class ipService = async () => {
    static getIpAddress() {
        return await axios.get("https://www.cloudflare.com/cdn-cgi/trace", {
            responseType: "text",
            transformResponse: data =>
                Object.fromEntries(data.trim().split("\n").map(line => line.split("=")))
        })
    }
}

Leave a comment