Property ‘next‘ does not exist on type ‘Component<any, {}, any>‘问题的解决方法
场景:使用antd的Carousel组件时,自定义左右切换按钮,触发组件的next(),prev()方法时报错
错误写法:
handleNext(){this.refs.img.next()}<Carouseldots={false}ref="img">...</Carousel>
handleNext是我自定义的按钮的切换下一个图片方法,通过refs获取Carousel组件实例,调用Carousel组件的next()方法
报错截图:
Property ‘next’ does not exist on type ‘Component<any, {}, any>’
解决方案:
handleNext(){(this.refs.img as any).next();}
Property ‘next‘ does not exist on type ‘Component<any, {}, any>‘问题的解决方法相关推荐
- Property ‘contentWindow‘ does not exist on type HTMLElement,类型htmlelement上不存在contentwindow属性
一.问题 Property 'contentWindow' does not exist on type HTMLElement 二.解决方法 /*** Property 'contentWindow ...
- 响应式编程时出现:error TS2339: Property 'debounceTime' does not exist on type 'Observableany'.
constructor() {this.searchInput.valueChanges//.debounceTime(500) 无法使用.pipe(debounceTime(1000)).subsc ...
- Angular响应式开发中报错Property 'map' does not exist on type 'Observable'.引用rxjs也没用。
Angular响应式开发源代码如下: import { Component, OnInit } from '@angular/core'; import {Observable} from 'rxjs ...
- TS2550: Property ‘entries‘ does not exist on type ‘ObjectConstructor‘.
问题:TS2550: Property 'entries' does not exist on type 'ObjectConstructor'. Do you need to change your ...
- property xxx does not exist on type Object报错
在TypeScript中如果按JS的方式去获取对象属性,有时会提示形如Property 'xxx' does not exist on type 'Object'的错误.下文代码中的'xxx'替换成你 ...
- No qualifying bean of type xxx‘ available 的一种解决方法
No qualifying bean of type xxx' available 的一种解决方法 参考文章: (1)No qualifying bean of type xxx' available ...
- ‘ActiveX component can’t create object解决方法
'ActiveX component can't create object解决方法 参考文章: (1)'ActiveX component can't create object解决方法 (2)ht ...
- SSH框架 Bean property * is not writable or has an invalid setter method错误分析与解决方法
转自:http://blog.csdn.net/naughty610/article/details/5619092 错误出现提示: org.springframework.beans.NotWrit ...
- configure: error: cannot guess build type; you must specify one解决方法
configure: error: cannot guess build type; you must specify one解决方法 参考文章: (1)configure: error: canno ...
最新文章
- 装饰器的定义、语法糖用法及示例代码
- g intel linux 汇编_Linux 下的C和Intel 汇编语言混用
- leetcode算法题--和为s的两个数字
- VMware虚拟机中CentOS根分区的扩展
- 2.12 向量化更多例子-深度学习-Stanford吴恩达教授
- matlab imfill孔洞填充
- kotlin泛型_Kotlin泛型
- Character的static方法
- android Cursor用法
- python web开发实战pdf 百度网盘_python web开发实战 pdf
- 神兽传说JAVA下载_神兽传说3-救赎大陆
- 兼容IE,Firefox,chrome等浏览器 : 设为首页和收藏的Javascript代码
- 利用Word2Vec在语料中构建种子词集同类词
- 用Bat文件创建桌面快捷方式
- 最优模型选择的准则:AIC、BIC准则
- (42.1)【操作系统漏洞发现专题】操作系统漏洞之简介、分类、危害、发现工具、利用
- [半监督学习] ReMixMatch: Semi-Supervised Learning with Distribution Alignment and Augmentation Anchoring
- 使用CMSTP绕过AppLocker
- 再也不担心写出臃肿的Flink流处理程序啦,发现一款将Flink与Spring生态完美融合的脚手架工程-懒松鼠Flink-Boot
- 有哪些好的3D建模软件,最近对3D建模很感兴趣?