Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

186
Views
Sometimes OK button doesn't work in alert in Vue page, what will be the problem?

I made a button to use an api to restart an application

That button works well. However, when it comes to alert popup, OK button sometimes doen't work. Even I click and click again, it doesn't close the alert popup. If I click it again after waiting a little moment like three seconds, then it close the alert popup normally. I don't know what will be the real problem, because I didn't experience this before. Can it be a browser(chrome)'s problem? Or vue framework's or nuxt framework's? I use nuxt framework in this code.

The code is below

restartApp.vue

<template>
    <button>restart</button>
</template>
<script>
import {
  createRestart
} from '@/api/agent'
export default {    
    methods:{
        restart() {
            if (confirm('Restart agent?')) {
                createRestart().then((res) => {
                    if (res.status == 200) {
                        alert('Agent is restarted')
                    }else{
                        alert("Agent isn't restarted")
                    }
                }).catch((err)=>{
                    alert('Agent has a error to restart >>', err)
                })
            }
        },
    }
}
</script>

@/api/agent.js

import axios from "axios";
import { headers } from "../config/env";

export function createRestart() {
  return axios.post("/api/agent/schedule/restart", {}, { headers });
}

/api.js

//(...)
router.post('/agent/schedule/restart', async (req, res) => {
    const axiosInstance = axios.create({ timeout:3000 });
    try {
      const result = await axiosInstance.post(
        "http://agentUrl" + '/v1/restart',
        {},
        config
      )
      res.json(result.data)
    } catch (err) {
      console.log(err)
      res.sendStatus(500)
    }
})
//(...)
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!