New Fw7 users with webpack

Hi everyone,

I just tried installing fw7 with cli. And I think the performance is very good compared to what I used before. Only I’m still somewhat confused with the structure and use of the module. Which is better, get request on routes.js or on pages? I tried getting a request on routes.js like this:

var routes = [
{
	path: '/',
	async(routeTo, routeFrom, resolve, reject) {
		this.app.request.json('url-api', function (data) {
			resolve(
				{
					component: Home,
				},
				{
					context: {
						data1: data.response,
					}
				}
			)
		});
		this.app.request.json('url-api', function (data) {
			resolve(
				{
					component: Home,
				},
				{
					context: {
						data2: data.response,
					}
				}
			)
		});
	},
},

Is it true or is there something more efficient?

This code is wrong for sure, as route can be resolved only once. You can use something like Promise.all to wait when all requests are finished, or load the data in component directly

Thank you very much for your kindness! I’ve changed the code to the html page. But having trouble calling foreach to swiper function.