场景:使用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>‘问题的解决方法相关推荐

  1. Property ‘contentWindow‘ does not exist on type HTMLElement,类型htmlelement上不存在contentwindow属性

    一.问题 Property 'contentWindow' does not exist on type HTMLElement 二.解决方法 /*** Property 'contentWindow ...

  2. 响应式编程时出现:error TS2339: Property 'debounceTime' does not exist on type 'Observableany'.

    constructor() {this.searchInput.valueChanges//.debounceTime(500) 无法使用.pipe(debounceTime(1000)).subsc ...

  3. Angular响应式开发中报错Property 'map' does not exist on type 'Observable'.引用rxjs也没用。

    Angular响应式开发源代码如下: import { Component, OnInit } from '@angular/core'; import {Observable} from 'rxjs ...

  4. TS2550: Property ‘entries‘ does not exist on type ‘ObjectConstructor‘.

    问题:TS2550: Property 'entries' does not exist on type 'ObjectConstructor'. Do you need to change your ...

  5. property xxx does not exist on type Object报错

    在TypeScript中如果按JS的方式去获取对象属性,有时会提示形如Property 'xxx' does not exist on type 'Object'的错误.下文代码中的'xxx'替换成你 ...

  6. No qualifying bean of type xxx‘ available 的一种解决方法

    No qualifying bean of type xxx' available 的一种解决方法 参考文章: (1)No qualifying bean of type xxx' available ...

  7. ‘ActiveX component can’t create object解决方法

    'ActiveX component can't create object解决方法 参考文章: (1)'ActiveX component can't create object解决方法 (2)ht ...

  8. SSH框架 Bean property * is not writable or has an invalid setter method错误分析与解决方法

    转自:http://blog.csdn.net/naughty610/article/details/5619092 错误出现提示: org.springframework.beans.NotWrit ...

  9. configure: error: cannot guess build type; you must specify one解决方法

    configure: error: cannot guess build type; you must specify one解决方法 参考文章: (1)configure: error: canno ...

最新文章

  1. 装饰器的定义、语法糖用法及示例代码
  2. g intel linux 汇编_Linux 下的C和Intel 汇编语言混用
  3. leetcode算法题--和为s的两个数字
  4. VMware虚拟机中CentOS根分区的扩展
  5. 2.12 向量化更多例子-深度学习-Stanford吴恩达教授
  6. matlab imfill孔洞填充
  7. kotlin泛型_Kotlin泛型
  8. Character的static方法
  9. android Cursor用法
  10. python web开发实战pdf 百度网盘_python web开发实战 pdf
  11. 神兽传说JAVA下载_神兽传说3-救赎大陆
  12. 兼容IE,Firefox,chrome等浏览器 : 设为首页和收藏的Javascript代码
  13. 利用Word2Vec在语料中构建种子词集同类词
  14. 用Bat文件创建桌面快捷方式
  15. 最优模型选择的准则:AIC、BIC准则
  16. (42.1)【操作系统漏洞发现专题】操作系统漏洞之简介、分类、危害、发现工具、利用
  17. [半监督学习] ReMixMatch: Semi-Supervised Learning with Distribution Alignment and Augmentation Anchoring
  18. 使用CMSTP绕过AppLocker
  19. 再也不担心写出臃肿的Flink流处理程序啦,发现一款将Flink与Spring生态完美融合的脚手架工程-懒松鼠Flink-Boot
  20. 有哪些好的3D建模软件,最近对3D建模很感兴趣?

热门文章

  1. 你了解视频 API 吗?
  2. 广数25i系统倒刀回刀m代码_基于广数GSK25i数控系统伺服刀库的控制
  3. amCharts下的JS图表
  4. 菜鸟学习JSP之第6章-servlet
  5. Cartographer中对激光雷达运动畸变的处理方法分析
  6. TED的字幕到哪里下载?介绍一个很好的网站
  7. 【MindSpore深度学习框架】MindSpore中的张量Tensor
  8. php画布生成图片/证书/卡片等实例
  9. 警惕:信用卡分期陷阱
  10. 记录基础学习第二_小项目_飞行棋小游戏