import Vue from ‘vue’
import App from ‘./App’
// 导入网络请求的包
import {$http} from '@escook/request-miniprogram’

import savefile from ‘@/new_file.js’
let mixins ={
onLoad(){
console.log(‘我是mixins’)
}
}
uni.mix=mixins//全局挂载uni.mix = mixins // 全局挂载 uni.mix=mixins//uni.http = $http
// 请求开始之前做一些事情
$http.beforeRequest = function (options) {
uni.showLoading({
title: ‘数据加载中…’,
})
}
// 请求完成之后做一些事情
$http.afterRequest = function () {
uni.hideLoading()
}
// 自动请求头
$http.baseUrl = ‘https://www.uinav.com’
Vue.config.productionTip = false

uni.$toast = function(title=‘数据加载失败’,duration=1500){
uni.showToast({
title,
duration,
icon:‘none’
})
}
App.mpType = ‘app’

const app = new Vue({
…App
})
app.$mount()

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐