uni-app
文章平均质量分 78
weixin_45585996
这个作者很懒,什么都没留下…
展开
-
uni-app封装路由
由于uni-app没有vue中的全局钩子函数,所以封装了Router对象首先我们创建一个JS文件,用于存放路由跳转的方法(文件路径src/utils/router.js)class Router { constructor() { this.callBack = () => {}; } beforeEach(callBack) { if (callBack instanceof Function) this.callBack = callBack; } push(to)原创 2020-09-18 18:30:35 · 1175 阅读 · 2 评论 -
uni-app封装request请求
config.js// export const baseURL = 'http://localhost:8081'// 小程序或app真机调试时使用export const baseURL = 'http://192.168.1.11:8081'request.jsimport { baseURL } from './config.js'export default function (options) { return new Promise((resolve, reject) =&原创 2020-08-12 18:02:17 · 1396 阅读 · 0 评论