欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 汽车 > 维修 > 【Taro】做项目过程中的一些问题记录

【Taro】做项目过程中的一些问题记录

2024/10/25 16:21:20 来源:https://blog.csdn.net/XiugongHao/article/details/142728578  浏览:    关键词:【Taro】做项目过程中的一些问题记录

待更新~

React is declared but its value is never read.

taro 中 ,eslint 中使用 import React from “react”; 报错: React is declared but its value is never read. 解决办法:
tsconfig 中 改为:

{"compilerOptions": {"jsx": "react",},
}

Absolute imports should come before relative imports.(import/first)

Absolute imports should come before relative imports.(import/first) 谁能想到这东西也是规范呢?根据报错提示更改引入规范即可。

import React from "react";
import { View } from "@tarojs/components";
import "./index.scss";

React refers to a UMD global, but the current file is a module. Consider adding an import instead.

引入 React 即可 :import React from “react”;

修改主题样式

修改主题样式,找到默认的样式类型,在 app.scss 中覆盖默认的类样式。

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com