2021年9月13日

摘要: 1、最直接整个页面重新刷新: // 使用location.reload()方法刷新页面 location.reload() // 使用Vue路由的$router.go()方法刷新当前页面 this.$router.go(0) 这两种都可以刷新当前页面的,缺点就是相当于按ctrl+F5 强制刷新那种, 阅读全文
posted @ 2021-09-13 22:55 完美前端 阅读(2494) 评论(0) 推荐(0)
摘要: 使用btoa进行Base64编码 // btoa只能编码ASCII字符串,如果有非ASCII字符,可能会导致错误。 // 定义一个json对象 let json = { channel: '100000', i_code: '3', invite_code: '' }; // 使用btoa将json 阅读全文
posted @ 2021-09-13 18:35 完美前端 阅读(2650) 评论(0) 推荐(0)
摘要: 获取URL中的查询参数 // 定义函数获取URL查询参数并返回一个对象 function GetRequest() { let url = location.href; // 获取完整的URL let theRequest = {}; if (url.indexOf('?') != -1) { le 阅读全文
posted @ 2021-09-13 18:20 完美前端 阅读(1689) 评论(0) 推荐(0)

导航