"export 'default' (imported as '...') was not found in ''..."

开发中遇到的一个简单问题 却花了我很长时间

//在一个js文件中导出fetch请求方法
import fetch from 'utils/fetch';

export function getCompanyList() {
  return fetch({
    url: '/wx/company/list',
    method: 'get'
  })
}
//在vue的script代码块中导出
import getCompanyList from 'api/recruitManage/index';

//调用请求
  methods: {
    getList() {
      getCompanyList().then(res => {
        if (res.errno == 0) {
          this.companys = res.data
        }
      });
    }
  }

编译时警告:

 warning  in ./src/views/oa/recruitManage/index.vue

23:6-20 "export 'default' (imported as 'getCompanyList') was not found in 'api/recruitManage/index'

一开始没看到警告 请求时报错 

[Vue warn]: Error in v-on handler: "TypeError: __webpack_require__.i(...) is not a function"

TypeError: __webpack_require__.i(...) is not a function

试了很久没有解决 最后发现时import语法问题

在import后面加上大括号解决
import {getCompanyList} from 'api/recruitManage/index';

import,export语法规范详解:http://es6.ruanyifeng.com/#docs/module#export

 

  • 7
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 7
    评论
2023/6/4 1 What is LG SourcingLGS 简介 Manufacturer Trade Importer Lowe's Manufacturer Lowe's LGS A wholly owned subsidiary of Lowe's Company, Inc. LOWES供应商培训资料全文共70页,当前为第1页。 2023/6/4 2 Mission of LG Sourcing我们的任务 To be the product driven sourcing division that supports and complements the marketing and merchandising strategy of the Lowe's Companies by developing, sourcing, and shipping trend-right, low cost, high value, reliable imported products from around the world, through a world class and socially responsible global infrastructure. LOWES供应商培训资料全文共70页,当前为第2页。 2023/6/4 3 Sourcing Core Function海外采购主要功能 Locate and qualify new factories and country sources Source and develop products and factories to Program Element Review sample iterations for US Program Development Negotiate pricing and terms Educate vendors on Lowe's requirements Project manage all new products Manage vendor performance LOWES供应商培训资料全文共70页,当前为第3页。 2023/6/4 4 Some Data About LG SourcingLGS 相关信息 2006 Earning In Billion US$ 2005 Earning In Billion US$ Company Earning Increase from Previous Year 20.49 18.71 Wal-Mart 9.53% 9.67 9.36 Home Depot 3.31% 3.11 2.76 Lowe's 12.30% 2.75 2.45 Walgreen 12.13% 2.24 2.03 Kroger 9.88% 1.62 1.47 Cosco 10.31% Lowe's is the fastest... LOWES供应商培训资料全文共70页,当前为第4页。 2023/6/4 5 Vendor Set Up创建供应商及其产品信息 Lowe's Vendor Set Up System 2. Vendor Set-up Sheet 3. Item Offer Sheet 1. Vendor information Sheet 1. Vendor Profile 2. Vendor Structure Form Other Information 4. PCM – Product Content Management 1SYNC Web Only LOWES供应商培训资料全文共70页,当前为第5页。 2023/6/4 6 Product Content Management (PCM) is: Lowes solution to replace the complex, manual processes that we have in place today and to improve the flow and accuracy of our current product data. A system that collects, synchronizes and validates product data. Part of the larger Global Standards effort several industries, including Lowes, are championing. A mandatory Lowe's initiative. Vendors will not be able to add new products or update e

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值