1 Star 0 Fork 168

enica/mall-app

forked from 有来开源/mall-app 
Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
main.js 998 Bytes
Copy Edit Raw Blame History
郝先瑞 authored 2021-01-13 00:57 . feat:会员地址
import Vue from 'vue'
import store from './store'
import App from './App'
import Json from './Json' //测试用数据
import * as filters from './filters' // global filters
const msg = (title, duration=1500, mask=false, icon='none')=>{
//统一提示方便全局修改
if(Boolean(title) === false){
return;
}
uni.showToast({
title,
duration,
mask,
icon
});
}
const json = type=>{
//模拟异步请求数据
return new Promise(resolve=>{
setTimeout(()=>{
resolve(Json[type]);
}, 500)
})
}
const prePage = ()=>{
let pages = getCurrentPages();
let prePage = pages[pages.length - 2];
// #ifdef H5
return prePage;
// #endif
return prePage.$vm;
}
Vue.config.productionTip = false
Vue.prototype.$fire = new Vue();
Vue.prototype.$store = store;
Vue.prototype.$api = {msg, json, prePage};
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()
// register global utility filters
Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key])
})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
HTML/CSS
1
https://gitee.com/null_385_1879/mall-app.git
git@gitee.com:null_385_1879/mall-app.git
null_385_1879
mall-app
mall-app
master

Search

0d507c66 1850385 C8b1a773 1850385