mithril 路由学习笔记
路由小坑
var Home = {
view: function() {
return m("a[href='/home2']", {oncreate: m.route.link}, "go to Home 2")
}
}
var Home2 = {
view: function() {
return m("a[href='#!/home']", "go to Home")
}
}
m.route(document.body, "/home", {
"/home": Home, // defines `http://localhost/#!/home`
"/home2": Home2,
})
0
See Also
Nearby
- 上一篇 › 又更新了
- 下一篇 › mithril 组件学习记录