目录
a标签
1、a标签,如果不加href属性,鼠标是点击的形状,加上href变成手性的形状,加上javascript:void(0)让ng-click起作用
<a ng-click="vm.userLogout();" href="javascript:void(0)">
<i class='fa fa-sign-out'></i> 退 出
</a>
location.href
设置或返回当前显示的文档的完整 URL
location.href="/login",当前页面打开/login页面,实现页面的跳转
js延迟执行setTimeout 参数传递
function changeWidth(){
};
setTimeout(changeWidth,2000);
这样是对的,setTimeout(changeWidth(),2000);这样写直接就执行了。function也可以用匿名函数。setTimeout(function(){ },1000);
js小数转成百分比
function toPercent(point) {
if (point == 0) {
return 0;
}
var str = Number(point * 100).toFixed();
str += "%";
return str;
}