|
|
import Vue from "vue";
|
|
import toast from "./toast/index.js";
|
|
import { play } from '@/utils/clickSound.js'
|
|
import dayjs from 'dayjs'
|
|
|
|
Vue.prototype.$isAppFn = function(){
|
|
if(typeof navigator == 'undefined'){
|
|
return true
|
|
}
|
|
const userAgent = navigator.userAgent.toLowerCase();
|
|
if (/ipad|iphone|midp|rv:1.2.3.4|ucweb|android|windows ce|windows mobile/.test(userAgent)) {
|
|
// 移动端
|
|
console.log('移动端')
|
|
return true
|
|
}
|
|
// pc端
|
|
console.log('PC端')
|
|
return false
|
|
}
|
|
|
|
Vue.prototype.$isApp = Vue.prototype.$isAppFn()
|
|
|
|
Vue.prototype.$play = play
|
|
Vue.prototype.$dayjs = dayjs
|
|
|
|
Vue.use(toast)
|