HolaMundo.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>Mientras llamo a la API, recibo ser como indefinido. No estoy seguro de por qué.
Adjuntando la imagen de abajo.
Donde si ve la imagen de arriba, para id, obtengo uno dinámico, y para ser. siempre se muestra como indefinido
¿Hay alguna manera de resolver ese problema?
¿O elegí el ser correctamente como pasar los parámetros de consulta correctamente?
Estoy pensando que, el problema es con la propiedad calculada donde, estoy devolviendo múltiples condiciones con , ¿creo que debería corregir la condición allí?