9***@qq.com
9***@qq.com
  • 发布:2021-02-08 15:31
  • 更新:2021-02-22 16:52
  • 阅读:534

#插件讨论# 【 luch-request[quanzhan.co] - luch 】http.get is not a function

分类:uni-app

main.js 文件

import * as http from './common/http/index.js'  

Vue.prototype.$http = http;

common/http/index.js 文件

import Request from '@/common/luch-request/index.js'  
const http = new Request();  
import {  
    baseUrl  
} from './baseUrl.js'

page/login/login.vue 文件

onLoad() {  
            console.log(this.$http);  
            console.log(this.$http.get());  
        },

为什么会报错呢?直接报not a function,大佬们要怎么解决啊?

2021-02-08 15:31 负责人:无 分享
已邀请:
luch

luch

import * as http from './common/http/index.js'

引入 不对。
发一下 导出的代码

该问题目前已经被锁定, 无法添加新回复