Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用 crossroads.js 制作路由器系统,例如,如果我转到此 URL:localhost/user/{{username}},然后获取该用户的详细信息,该用户的详细信息已在带有 firebase 的 URL 中输入。
一次获取用户详细信息:
var database = firebase.database(); var route1 = crossroads.addRoute('/user/{username}', function(id){ firebase.database().ref('/user/' + id).once('value').then(function(snapshot) { var username = snapshot.val().username; // ... }); });