mirror of
https://github.com/flarum/framework.git
synced 2025-05-22 06:39:57 +08:00
Patch Mithril with a route shortcut attribute
Instead of: <a href={app.route.user(user)} config={m.route}> We can use: <a route={app.route.user(user)}>
This commit is contained in:
@ -14,6 +14,13 @@ export default function patchMithril(global) {
|
||||
m.bidi(node, node.attrs.bidi);
|
||||
}
|
||||
|
||||
if (node.attrs.route) {
|
||||
node.attrs.href = node.attrs.route;
|
||||
node.attrs.config = m.route;
|
||||
|
||||
delete node.attrs.route;
|
||||
}
|
||||
|
||||
return node;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user