初学者简单的方法,目前还没有遇到问题

想法很简单,当export导出,骗eslint认为是一个模块。

如果有新的问题欢迎留言,我也在学习

1 import utilsApi from '../utils/api';

下面是我的写法,确实不报错了。

1 const utilsApi = module.exports = {
2
3 }
4 export default utilsApi

小程序TS报错 "无法重新声明块范围变量。此处也声明了xx "的更多相关文章

  1. wepy开发小程序eslint报错error 'getApp' is not defined no-undef

    wepy开发小程序使用getApp().globalData保存全局数据很方便,但是会在控制台看到很多报错:“error 'getApp' is not defined no-undef”,这是esl ...

  2. 微信小程序--分享报错(thirdScriptError Cannot read property 'from' of undefined;at pages/index/index page onShareAppMessage function TypeError: Cannot read property 'from' of undefined)

    分享功能: onShareAppMessage: function (res) { if (res.from === 'button') { // 来自页面内转发按钮 console.log(res. ...

  3. 小程序运行报错:errMsg: "request:fail url not in domain list"

    错误原因: 报错提示说请求的url不在域名列表里,应该是还没有配置服务器域名 解决方法: 可点击开发者工具右上角 详情-项目设置-不校验合法域名.web-view(业务域名).TLS 版本以及 HTT ...

  4. 微信小程序地图报错——ret is not defined

    刚刚在使用微信的map做地图时候 发现如下报错: 后来找了一会发现错误为经纬度写反了导致经纬度超出了范围 正确取值范围: latitude   纬度  浮点数,范围 -90 ~ 90 longitud ...

  5. 微信小程序:报错fail webview count limit exceed

    报错: 分析原因: 先从列表页面跳转到详细页面时,使用了Navigator标签,open-type默认使用的navigate,跳转时会保留当前页, <navigator class=" ...

  6. 小程序运行报错navigateTo:fail page "pages/warn/warn" is not found

    在index.js中配置触发时页面转发 wx.navigateTo({ url: '../warn/warn', }) 实际上触发时报错页面找不到 原因是页面路径没有在app.json里面没有定义过, ...

  7. 微信小程序WebSocket报错:Error during WebSocket handshake: Sent non-empty 'Sec-WebSocket-Protocol' header but no response was received

    Error during WebSocket handshake: Sent non-empty 'Sec-WebSocket-Protocol' header but no response was ...

  8. 小程序分享报错 Cannot read property 'apply' of null;at page XXX onShareAppMessage function

    Cannot read property 'apply' of null;at page XXX onShareAppMessage function 然后看了下自己的代码,分享按钮在子组件里, at ...

  9. 关于在使用sparksql写程序是报错以及解决方案:org.apache.spark.sql.AnalysisException: Duplicate column(s): "name" found, cannot save to file.

    说明: spark --version : 2.2.0 我有两个json文件,分别是emp和dept: emp内容如下: {"name": "zhangsan" ...

  10. 彻底解决 TypeScript 报错:“无法重新声明块范围变量”的问题

    背景 当使用 TypeScript + TSlint + Babel + Jest 搭建开发环境时,在开发过程中偶尔会被 IDE 提示「无法重新声明块范围变量」,从而导致编译出错,报错图示如下: 相关 ...

随机推荐

  1. thread互斥测试

    thread互斥测试 实践代码 #include <stdio.h> #include <stdlib.h> #include <pthread.h> //linu ...

  2. decay_rate, decay_steps ,batchsize,iteration,epoch

    (96条消息) decay_rate, decay_steps ,batchsize,iteration,epoch_hellocsz的博客-CSDN博客_decay_steps (1)batchsi ...

  3. 搭建rust开发环境

    1.打开https://www.rust-lang.org/tools/install 下载64位安装器 选择第一项默认安装 安装器会下载安装rust 相关工具链,并添加path C:\Users\z ...

  4. debian 系统中安装中文输入法

    debian wiki 中关于此主题的文档 :https://wiki.debian.org/InputMethodBuster 在图形界面选择 gnome,输入法程序选择 ibus 的情况下,配置较 ...

  5. burpsuite 设置文字大小、抓取https数据头

    设置文字大小 burpsuite安装好后,有些时候文字非常的小,看的眼睛直接痛死. 找到 User options -> Display 其中 User Interface -> Font ...

  6. 【微信网页授权】SpringBoot+uniapp实现网页授权获取用户基本信息

    前言 缘由 起因于本狗上一个项目本打算采用微信公众号网页授权登录做用户鉴权,但最终因公众号是未认证的订阅号,无权限获取用户信息,所以改变思路,采用登录注册方式实现用户区分.但在开发中,学习了微信网页授 ...

  7. Java面试——Spring

    一.Spring Bean 作用域 [1]singleton:该属性在 IOC容器仅创建一个 Bean实例(单例),IOC容器每次返回的是同一个 Bean实例.[2]prototype:该属性在 IO ...

  8. Facebook 的 Thrift

    更多内容,前往个人博客 Thrift 源于 Facebook,在 2007 年 Facebook 将 Thrift 作为一个开源项目提交给了 Apache 基金会.对于当时的 Facebook 来说, ...

  9. git命令的学习和基本使用

    初始化 git init (your_project) 配置 --local 只对当前仓库有效 --global 对当前用户所有仓库有效 --system 对系统登录的所有用户有效 git confi ...

  10. ACM-CodeForces-#685(Div.2)

    好久没见过CF有这么水的contest了,蒟蒻赶紧找找自信 A. Subtract or Divide #include<iostream> using namespace std; in ...