Files
jobslink-user-clent/main.js

73 lines
1.9 KiB
JavaScript
Raw Normal View History

2024-04-14 16:13:44 +08:00
import Vue from 'vue'
import store from './store';
import App from './App'
import util from './untils/func.js'
import uView from '@/uni_modules/uview-ui'
import config from './config';
2024-04-22 22:31:50 +08:00
import tools from '@/untils/tools.js'
2024-04-15 15:30:10 +08:00
import {
VueJsonp
} from 'vue-jsonp'
2024-04-14 16:13:44 +08:00
// 注册全局组件
// import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"
// import MescrollUni from "@/components/mescroll-uni/mescroll-uni.vue"
// Vue.component('mescroll-body', MescrollBody)
// Vue.component('mescroll-uni', MescrollUni)
import empty from '@/components/empty/empty.vue'
2024-10-24 14:42:47 +08:00
function haslogin() {
return !!store.state.user.token
}
2024-04-14 16:13:44 +08:00
function navTo(url, needLogin) {
console.log(url)
if (needLogin) {
return
}
uni.navigateTo({
url: url
})
}
const msg = (title, duration = 1500, mask = false, icon = 'none') => {
uni.showToast({
title,
duration,
mask,
icon
});
}
2024-04-18 20:50:22 +08:00
const sleep = (time) => new Promise(resolve => setTimeout(resolve, time))
2024-04-14 16:13:44 +08:00
// 注册全局组件
import JlButton from "@/components/jl-button/main.vue"
import JlForm from "@/components/jl-form/main.vue"
import JlFormItem from "@/components/jl-form/item.vue"
import CSButton from "@/components/cs-button/main.vue"
2024-05-15 16:16:35 +08:00
import superMapView from '@/components/uMapView/uMapView.vue';
2024-04-14 16:13:44 +08:00
Vue.component('jl-button', JlButton)
Vue.component('jl-form', JlForm)
Vue.component('jl-form-item', JlFormItem)
Vue.component('cs-button', CSButton)
2024-10-24 14:42:47 +08:00
// Vue.component('super-map', superMapView)
2024-04-14 16:13:44 +08:00
Vue.component('empty', empty)
Vue.prototype.$api = {
2024-04-18 20:50:22 +08:00
msg,
2024-10-24 14:42:47 +08:00
sleep,
haslogin
2024-04-14 16:13:44 +08:00
}
2024-04-22 22:31:50 +08:00
Vue.prototype.tools = tools
2024-04-14 16:13:44 +08:00
Vue.prototype.$config = config
Vue.prototype.navTo = navTo
Vue.config.productionTip = false
2024-04-15 15:30:10 +08:00
Vue.use(VueJsonp)
2024-04-14 16:13:44 +08:00
Vue.use(util)
Vue.use(uView)
App.mpType = 'app'
const app = new Vue({
...App,
store
})
app.$mount()