![](/img/trans.png)
[英]NGRX reducer problem : Argument of type "X" is not assignable to parameter of type "Y"
[英]Error on drag and drop action on protractor typescript, Argument of type '“{x: 540, y: 504}”' is not assignable to parameter of type 'ILocation'
我需要有關此腳本的幫助,我在打字稿上的拖放操作遇到此錯誤。 任何想法如何解決這個問題?
browser.actions().
mouseDown(element(by.id('waze_map1')), '{x: 191, y: 56}').
mouseMove(element(by.id('waze_map1')), '{x: 540, y: 504}').
mouseUp().
perform();
發生了錯誤:
Argument of type '"{x: 540, y: 504}"' is not assignable to parameter of type 'ILocation'.ts(2345)
ILocation接口是{x:number,y:number}
但是您嘗試設置字符串
變化:
browser.actions().
mouseDown(element(by.id('waze_map1')), '{x: 191, y: 56}').
mouseMove(element(by.id('waze_map1')), '{x: 540, y: 504}').
mouseUp().
perform();
至
browser.actions().
mouseDown(element(by.id('waze_map1')), '{x: 191, y: 56}').
mouseMove(element(by.id('waze_map1')), {x: 540, y: 504}).
mouseUp().
perform();
。 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.