D
D
Dauren S2020-09-23 11:34:53
Vue.js
Dauren S, 2020-09-23 11:34:53

Show list data again in detail view?

There is a component in which I take data from the api

import axios from "axios";
axios.defaults.withCredentials = true;
export default {
    name: "Index",
    data: function() {
        return {
            data:{
                lastname:null,
            },
            list:null,
             
        };
    },
    mounted() {
         axios
        .post('/api/test/cm/main/index')
        .then(response => (this.list=response['data']['list']),
   
      )
       .catch(function () {
            
             self.$router.push('/');
            
          });
    },
  
  
};

Then when you click on
<router-link  to="/test/main/view/1">Просмотр</router-link>

A detailed page is shown, but I want to display the same list next to it (on another page)
How to show this list so as not to make a request to the api again?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
VegasChickiChicki, 2020-09-23
@dauren101

Use vuex or pass to another page via props.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question