摘要: ```js /** * 如果data是整型字符串,则转为整型,否则原样返回 * @param {*} data 整型字符串 */ export const stringToInt = (data) => { if (/^\d+$/.test(data)) { return parseInt(data, 10); } return data; } ``` 阅读全文
posted @ 2018-12-19 00:47 jser_dimple 阅读(235) 评论(0) 推荐(0) 编辑
/*function gotourl() { var url = "https://www.cnblogs.com/smart-girl/"; var localurl = document.url; if( localurl.substring(0,url.length) != url ) { location.href=url; } } gotourl();*/