/* * @Description: * @Author: Napier * @LastEditors: Napier * @LastEditorTime: */ /* * @Description: * @Author: Napier * @LastEditors: Napier * @LastEditorTime: */ export default { /** * @description:判断是否为移动端 * @returns {Boolean} */ isMobile: function () { // var ua = navigator.userAgent // var ipad = ua.match(/(iPad).*OS\s([\d_]+)/) // var isIphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/) // var isAndroid = ua.match(/(Android)\s+([\d.]+)/) // var isMobile = isIphone || isAndroid // return isMobile if (navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad)/i)) { return true } else { return false } } }