//封装方法
export const getExplorer = () => {
const ua = window.navigator.userAgent
const isExplorer = (exp) => {
return ua.indexOf(exp) > -1
}
if(isExplorer('MSIE')) return 'IE'
else if(isExplorer('Firefox')) return 'Firefox'
else if(isExplorer('Chrome')) return 'Chrome'
else if(isExplorer('Opera')) return 'Opera'
else if(isExplorer('Safari')) return 'Safari'
}
封装好这方法以后,在要使用该方法的vue文件里import就行了