【常用公共方法】移动端常用(一)
作者:
北极星丶超帅的 | 来源:发表于
2019-05-29 16:31 被阅读0次
export const isWechat = /(micromessenger|webbrowser)/.test(navigator.userAgent.toLocaleLowerCase())
判断是否手机端
export const isPhone = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
存储当前历史记录点,实现控制手机物理返回键的按钮事件
export const pushHistory = () => {
let state = {
title: '',
url: ''
}
window.history.pushState(state, state.title, state.url)
}
判断
本文标题:【常用公共方法】移动端常用(一)
本文链接:https://www.haomeiwen.com/subject/raiytctx.html
网友评论