khamsat khamsat khamsat

Router


<script>
var app =  Router.View("fn-data");
	app.createSPA({
	    v1:{
	        when:"page1",
	        title:"",
	        url:"page1.php"
	    },
	    v2:{
	        when:"about",
	        title:"",
	        url:"page2.php"
	    },
	    v3:{
	        when:"contact",
	        title:"",
	        url:"page3.php"
	    },
});
</script>
    

Route to Component

you can route Component with jsH with getComponent key but you need to unset url key .


<script>
var app =  Router.View("fn-data");
	app.createSPA({	   
	    login:{
	        when:"login",
	        title:"",
	        getComponent:"loginComponent"
	    },
});
</script>
    

<Component hidden loginComponent >
  <form>
     <input type="text" name="user" />
     <input type="password" name="pass" />
     <input type="submit"   name="login" value="login" />
  </form>
</Component>
    

<div fn-data ></div>  
<a href="#login" >login</a>  
    
khamsat khamsat khamsat khamsat