vegana
Version:
vegana is a container based js framework
47 lines • 3.39 kB
JSON
{
"template": [
"2iyza37wkm613isc"
],
"rows": {
"2iyza37wkm613isc": {
"id": "2iyza37wkm613isc",
"template": [
"2iyza37wkm613jqs",
"2iyza37wkm613r44",
"2iyza37wkm613rk4"
],
"containers": {
"2iyza37wkm613jqs": {
"id": "2iyza37wkm613jqs",
"field": {
"type": "heading",
"data": {
"value": "vegana panel module router"
}
}
},
"2iyza37wkm613r44": {
"id": "2iyza37wkm613r44",
"field": {
"type": "paragraph",
"data": {
"value": "\nvegana panel module can be routed on panel router all needed steps to navigate are given below please follow all steps."
}
}
},
"2iyza37wkm613rk4": {
"id": "2iyza37wkm613rk4",
"field": {
"type": "code",
"data": {
"value": "\n\n//-----------------------------------\n//\tmake panel module\n//-----------------------------------\n/*\n\n\t//you can make panel module with vegana cli\n //for more information see the cli documents\n \n $ vegana generate panel first\n \n $ vegana generate panel second\n\n*/\n\n//-----------------------------------\n//\tmake panel router\n//-----------------------------------\n/*\n\n\tthis router should only be made on the cont module\n\n\trouter params\n \n engine.router.init.panels(cont_id_string,router_class_string);\n\n*/\n\nengine.router.init.panels(contId,\"panel-router-class\");\n\n//-----------------------------------\n//\tintegrate panel\n//-----------------------------------\n/*\n\n\tthe panel module will integrate automatically once you require it in your cont module.\n \n panel module should only be loaded in there parent cont module.\n\n*/\n\n\nrequire(\"./panels/firstPanel/panel\");\n\n//-----------------------------------\n// integrate lazy panel\n//-----------------------------------\n/*\n\n\tlazy panel first are neede to be loaded on to the app.\n\n*/\n\nconst loadFirstPanel = await engine.loader.load.panel(\"firstPage\",\"firstCont\",\"firstPanel\")\n.then(()=>{\n\treturn true;\n})\n.catch(()=>{\n\treturn false;\n});\n\n//-----------------------------------\n// get panel modules\n//-----------------------------------\n/*\n\n\tcall panelModule sub-api in get api of engine to get panelModule.\n\n*/\n\nlet firstPanel = engine.get.panelModule(\"firstPage\",\"firstCont\",\"firstPanel\");\n\n//-----------------------------------\n//\troute to new panel\n//-----------------------------------\n/*\n\n\t//navigator params\n \n engine.router.navigate.to.panel(panel_module_object,{data_to_pass})\n\n*/\n\n//route to prebuilt or new panel module\nengine.router.navigate.to.panel(firstPanel,{data_to_pass});\n\n//rebuild panel module\n//this api removes the old panel module body and makes a new one.\nengine.router.navigate.new.panel(firstPanel,{data_to_pass});\n\n//-----------------------------------\n//\tthis wont execute here\n//-----------------------------------\n"
}
}
}
}
}
},
"title": "Vegana Api : Engine Router Panel",
"discription": "how to route to a panel module in vegana js.",
"keywords": "vegana,api,engine,router,panel,init,make,to,new"
}