如何在CanJS中更改路由url

How can i change route url in CanJS

本文关键字:路由 url CanJS      更新时间:2024-01-11

我有路由。属性:

can.route.attr({type:"list",id:"list",val:""})
location.hash -> "#!update/edit&val=113"

我怎么能把它改成#!在url 中列出/列出并销毁val:"

我使用这个:can.route.attr({type:"list",id:"list",val:null})

location.hash -> "#!update/edit&val="

与其他can.Map非常相似,从can.route中完全删除密钥需要使用can.route.removeAttr("val")。试试看;您应该看到&val=从散列中完全消失。