3 Star 46 Fork 6

编程民工/uniapp移动端开发框架

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.js 1.62 KB
一键复制 编辑 原始数据 按行查看 历史
编程民工 提交于 2023-04-30 20:46 +08:00 . 重新封装接口请求和全局配置
import Vue from 'vue'
import App from './App'
import store from './store'
// 引入导航栏组件
import uniNavBar from '@/components/uni-nav-bar/uni-nav-bar.vue'
Vue.component('uniNavBar',uniNavBar)
//导入自己封装的类库
import sjuAsync from './common/sju.async.js'
import sjuBase from './common/sju.base.js'
import sjuAlert from './common/sju.alert.js'
import sjuRegex from './common/sju.regex.js'
import sjuLogin from './common/sju.login.js'
import sjuNav from './common/sju.nav.js'
import sjuPay from './common/sju.pay.js'
import sjuTools from './common/sju.tools.js'
import sjuRequest from './common/sju.request.js'
// #ifdef H5
import sjuWeixin from './common/sju.weixin.js'
// #endif
// 将封装库引入Vue原型链
Vue.prototype.sjuAsync = sjuAsync
Vue.prototype.sjuBase = sjuBase
Vue.prototype.sjuAlert = sjuAlert
Vue.prototype.sjuRegex = sjuRegex
Vue.prototype.sjuLogin = sjuLogin
Vue.prototype.sjuNav = sjuNav
Vue.prototype.sjuPay = sjuPay
Vue.prototype.sjuTools = sjuTools
Vue.prototype.sjuRequest = sjuRequest
// #ifdef H5
Vue.prototype.sjuWeixin = sjuWeixin
// #endif
// 全局变量
// 设置H5分享参数全局变量
Vue.prototype.$title='分享标题'
Vue.prototype.$desc = '分享描述'
Vue.prototype.$shareImage = '图片路径'
// 小程序分享分享设置
// #ifdef MP
import share from './mixin/sju.share.js'
Vue.mixin(share)
// #endif
// 引入全局mixin
import mixin from './mixin/sju.mixin.js'
Vue.mixin(mixin)
Vue.config.productionTip = false
Vue.prototype.$store = store
App.mpType = 'app'
const app = new Vue({
store,
...App,
})
app.$mount()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/yunhaotian/uniapp_mobileFrame.git
git@gitee.com:yunhaotian/uniapp_mobileFrame.git
yunhaotian
uniapp_mobileFrame
uniapp移动端开发框架
master

搜索帮助