Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

252
Visualizações
How to create a unique identifier for a Vue JS 2 App

I'm wondering if there is a nice way to have a UUID for a Vue JS 2 App.

I'm currently developing a Laravel API that is consumed by Android/IOS devices that identifies themselves by using the installation_id. Since it only changes on new app installation, it seems like the best approach for this purpose.

Now I have to develop the Vue JS app, but of course, there is no such thing. I've found this package but unfortunately, it only supports Vue JS 3: https://github.com/VitorLuizC/vue-uuid

Basically, what I need is to have uuid per app instance which persist on page refresh and even of hard refresh (not sure if possible at all) meaning clearing the app data from localStorage.

So far, I can only imagine creating a random uuid using this and storing it on localStorage, then on app mount check if this uuid exists on localStorage and if not, store it, otherwise just continue on.

import { v4 as uuidv4 } from 'uuid'
...
new Vue({
    router,
    mounted () {
        if (!localStorage.getItem('installation_id')) {
            localStorage.setItem('installation_id', uuidv4())
        }
    }
    render: h => h(App)
}).$mount('#app')

I will appreciate any help to get the right path to achieve this.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda