vue项目中判断当前页面是否存在某个动态路由路径
let title = that.$route.path; //获取当前路由路径
let routerStr = that.$store.state.route_url; //某个动态路由
function isContains(title, routerStr) {
return title.indexOf(routerStr) >= 0;
}
console.log(isContains(title, routerStr));
返回 true 或 false