TS
呆子小木心
你不是low炮一枚,你已经是一个成熟的程序员,要学会自己找原因
展开
-
react 使用router 和 ts 进行页面跳转报错
使用react路由器v4和Typescript以编程方式导航时出错:Property 'history' does not exist on type 'Readonly & Readonly<{ children?: ReactNode; }>解决方法:你需要导入import { RouteComponentProps } from “react-router-dom”; RouteComponentProps接口有你正在寻找的道具。例如:import {RouteComp原创 2021-01-06 11:16:37 · 1645 阅读 · 0 评论 -
react使用antd警告:Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance
react使用antd警告:Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance警告内容:Warning: findDOMNode is deprecated in StrictMode. findDOMNode waspassed an instance of Wave which is inside StrictMode. Instead, add aref directly t原创 2021-01-05 11:40:48 · 452 阅读 · 0 评论 -
react中使用ts配置路由时报错:Could not find a declaration file for module ‘react-router-dom‘
react中使用ts配置路由时报错:Could not find a declaration file for module ‘react-router-dom’原来引入,会报错Could not find a declaration file for module ‘react-router-dom’:import {Router,Route,Switch,Redirect} from 'react-router-dom';解决方法:const {Router,Route,Switch,Redi原创 2021-01-04 11:56:03 · 3959 阅读 · 1 评论 -
在vue + ts 项目中引入echarts
第一种indext.html中用script引入<script src="https://cdn.bootcss.com/echarts/4.2.1-rc1/echarts-en.common.min.js"></script>组件中调用方式<script >import { Component , Vue } from 'vue-property-decorator';declare let echarts:any; //要先声明@Component原创 2020-12-23 10:58:25 · 1871 阅读 · 0 评论 -
报错:Parameter ‘XXX‘ implicitly has an ‘any‘ type.解决方法
报错:Parameter ‘XXX’ implicitly has an ‘any’ type.解决方法tsconfig.json添加"noImplicitAny": false,或者 “strict”: true,改为false{ "compilerOptions": { "target": "es5", "module": "commonjs", "moduleResolution": "node", "sourceMap": true, "emitDe原创 2020-12-16 10:09:25 · 32798 阅读 · 4 评论 -
解决vue+ts中报错:Cannot read property ‘push‘ of undefined
解决vue+ts中报错:Cannot read property ‘push’ of undefined一,出现的问题:在vue项目中,用TypeScript定义了一个数组,遍历操作的时候,进行push操作时,查看控制台竟然出现“Cannot read property ‘push’ of undefined”错误, 代码如下:public arr: Array<string>;public created() { for(let i = 0; i < this.rout原创 2020-12-15 18:53:45 · 3623 阅读 · 1 评论