Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add route from external API #2194

Open
huzaifah-ivan opened this issue Jun 2, 2019 · 1 comment
Open

add route from external API #2194

huzaifah-ivan opened this issue Jun 2, 2019 · 1 comment

Comments

@huzaifah-ivan
Copy link

Hii Guys,

i would like to thank that framework is awesome...

i tried and explorer the framework for my project. it is possible to render the menu (sidebar) where the menu item from the external API?? any one could give me an example??

Thank you

@ljluestc
Copy link

// Assuming you have Axios installed
import axios from 'axios';

export default {
  data() {
    return {
      menuItems: [],
    };
  },
  mounted() {
    // Fetch menu data from the external API
    axios.get('your_external_api_url')
      .then((response) => {
        this.menuItems = response.data; // Assuming the API returns an array of menu items
      })
      .catch((error) => {
        console.error('Error fetching menu data:', error);
      });
  },
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants