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

165
Visualizações
Issue with query params getting undefined in Vuejs?

HelloWorld.vue

import axios from "axios";
export const deploymentattribute = (Ser, id) =>
    axios.get(
        `http://api call here......
    );
<template>
  <div>
    <div v-for="(attribute, index) in attributes" :key="index">
      {{ attribute.att }}
    </div>
  </div>
</template> 

<script>
import { deploymentattribute } from "../../assets/deploymentattribute";
export default {
  name: "DeploymentAttributeView",
  data() {
    return {
      attributes: [],
    };
  },
  mounted() {
    this.loadData();
  },
  computed: {
    deploymentattribute() {
      return this.$route.query.Ser, this.$route.query.id;
    },
  },
  methods: {
    loadData() {
      if (!this.deploymentattribute) return; // no ID, leave early
      deploymentattribute(
        this.$route.params.Ser,
        this.$route.params.id
      ).then((attribute) => {
        this.attributes = attribute.data;
      });
    },
  },
 </script>

While calling the api, i am getting ser as undefined. Not sure why.

Attaching the image below.

Where if u see above image, for id, i am getting dynamic one, and for ser. it is always showing as undefined

Is there any way to solve that issue.

Or did i choose the ser correctly like passing query params correctly?

I am thinking that, issue is with the computed property where, i am returning multiple conditions with , i think i schould right the condition there?

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